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

Dependent cache items #87

Closed
roker opened this issue Aug 6, 2018 · 1 comment
Closed

Dependent cache items #87

roker opened this issue Aug 6, 2018 · 1 comment

Comments

@roker
Copy link

roker commented Aug 6, 2018

This is one feature I found missing in all type of caches. The cached items cant be atomically made dependant to one another, the simple case would be paging:

GET /somepage/paging-1 --> cache.set("/something/paging-1", content)
GET /somepage/paging-2 --> cache.set("/something/paging-2", content)
GET /somepage/paging-3 --> cache.set("/something/paging-3", content)
POST /somepage --> cache.invalidate("/something/paging-*)

The iterator can be used, but if a lot of entries are cached, it really isnt efficient. Some additional logic would be fine, to specify that "/something/paging-1" is dependant to "/something/" and invalidates/calls hook if "/something/" has changed. It is not an issue to implement a map but since it has to be atomic to avoid race conditions (one client invalidates cache, the second is requesting it), it would be really nice if it would be implemented on bigcache level to automatically create a hierarchy where changing one item invalidates all dependent items.

@siennathesane
Copy link
Collaborator

I would recommend storing that information outside of the cache as that's a bit outside the scope of what we're trying to achieve at this stage. I do think it's interesting, but we're not there now. :)

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

No branches or pull requests

2 participants