Skip to content

Refactor backend cache#58

Merged
shioyama merged 5 commits into
masterfrom
refactor_cache
Jul 26, 2017
Merged

Refactor backend cache#58
shioyama merged 5 commits into
masterfrom
refactor_cache

Conversation

@shioyama

@shioyama shioyama commented Jul 23, 2017

Copy link
Copy Markdown
Owner

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 shioyama force-pushed the refactor_cache branch 4 times, most recently from 1143108 to 83cf416 Compare July 24, 2017 13:35
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
@shioyama shioyama deleted the refactor_cache branch July 26, 2017 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant