Add a CachingStorage
ClosedPublic

Authored by ervin on May 13 2017, 4:03 PM.

Details

Summary

This one will forward all requests to the real storage but will also
store the results in the cache. For now it only forwards.

In this patch we plug the CachingStorage instead of the regular
Storage in the acceptance tests and the applications, we also add a new
set of integration tests going through this new storage. This should
help catch regression early.

The behavior parts to feed the cache will come in later commits.

Diff Detail

Repository
R4 Zanshin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ervin created this revision.May 13 2017, 4:03 PM
dfaure accepted this revision.May 14 2017, 10:05 PM
This revision is now accepted and ready to land.May 14 2017, 10:05 PM

Random thought: a ProxyStorage base class for CachingStorage could generalize this implementation, just in case there's more need for "reimplement all methods by forwarding to another storage, except for one method".

ervin added a comment.May 15 2017, 2:03 PM

Random thought: a ProxyStorage base class for CachingStorage could generalize this implementation, just in case there's more need for "reimplement all methods by forwarding to another storage, except for one method".

Well, won't be "except for one method" in the end. I did it for only one fetch type but the goal is to cover them all. Beside such class would be easy to extract after the fact if the need ever arises.

bensi accepted this revision.May 16 2017, 8:02 AM
This revision was automatically updated to reflect the committed changes.