New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor backend cache #58

Merged
merged 5 commits into from Jul 26, 2017

Conversation

Projects
None yet
1 participant
@shioyama
Owner

shioyama commented Jul 23, 2017

The current code is unnecessarily complicated. This PR simplifies things so that backends can include a custom module through an apply_module hook. This allows KeyValue and Table backends to modify the Cache module they use just slightly to achieve the same result.

A module builder called TranslationCacher is shared by all cacheing strategies to cache reads; the only difference is which method is cached: in the default Cache module, read is cached; in KeyValue and Table backends, translation_for is cached (so that the translation record itself is cached, rather than the translation value).

shioyama added some commits Jul 24, 2017

Refactor backend cache
This commit restructures the current cache to allow the backend to
customize the included module, simplifying greatly the code.

@shioyama shioyama merged commit 391112b into master Jul 26, 2017

3 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@shioyama shioyama deleted the refactor_cache branch Jul 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment