Skip to content
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

rework cache invalidation using generation tags #18

Closed
iay opened this issue Sep 19, 2014 · 1 comment
Closed

rework cache invalidation using generation tags #18

iay opened this issue Sep 19, 2014 · 1 comment
Assignees

Comments

@iay
Copy link
Owner

iay commented Sep 19, 2014

At present, the MetadataService layer maintains a cache of Results which it invalidates whenever it (periodically) asks the ItemCollectionLibrary to refresh the collection. This is suboptimal in several ways, and will tend to cause cached results to be discarded more frequently than they need to be if the ItemCollectionLibrary gets more intelligent about refresh, for example by pre-checking the source document and retaining previous results if the source document has not changed (aside: this probably requires reworking the single source pipeline into a document fetch and processing pipeline). It also doesn't work at all if several MetadataServices are clients of the same ItemCollectionLibrary.

A better solution would be to attach a generation tag (e.g., a UUID) to each IdentifiedItemCollection and have the MetadataService remember that in its cache along with the corresponding Result. The MetadataService would then revalidate cache contents by making an IdentifiedItemCollection query and comparing generation tags. If the tag matched, the cached Result would still be valid; if not, the cached Result would be discarded.

This would also move the control of refresh firmly back into ItemCollectionLibrary, which I think is preferable to the current hack.

@iay iay self-assigned this Sep 19, 2014
@iay iay changed the title rework cache rework cache invalidation using generation tags Sep 19, 2014
@iay
Copy link
Owner Author

iay commented Mar 14, 2015

Done in 4f0f417 to a7cfb83.

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

No branches or pull requests

1 participant