How to handle dynamic cache invalidation #10013
thecaffeinatedengineer
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I posted a question on the same topic on slack and someone said it isn't supported yet but would be a good feature.
When using the
proxy-cache
plugin, is there a smart way to invalidate the cache after an entity update? For example I have a post entity that is in the cache. After I update the post’s description or title, I expect other users to get the newly updated version of the entity with the new title / description. The first GET request after the update can be aMISS
, but the following requests should beHIT
s.I read the docs and I am not clear on how to invalidate rest api caches in a smart way, as I am coming from GraphQL land. In some Graphql CDNs this is possible through the use of mutation based cache invalidation. Each entity has a unique entity id and the CDN can see that an entity has been update as the mutation would have passed through the CDN as well.
I am wondering how to achieve something similar programmatically. if possible, can the single post we have updated, also be updated in a cached list of posts ?
I am aware that this isn't currently achievable, so my question is. How are other people handling cache invalidation ? Surely this must be a common problem when caching responses. Or do people just cache data that rarely changes only ?
Beta Was this translation helpful? Give feedback.
All reactions