You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although Service Caching was built to sort of mirror the Rails implementation of caching (which is, of course, perfect), there could be cases where you want to invalidate a key manually, rather than always trying to come up with a unique key. For example, if calling an updatePost service function, invalidate the key created in the post function.
Motivation
We gave a demo of Service Caching during office hours in Discord and @dthyresson brought up the idea of invalidating an existing key, specifically for a weird issue that came up with caching a post by it's id only, not including an updatedAt timestamp. There'd be no way to bust that cache, and actually trying to get the updatedAt stamp would mean we'd have to query the post to get it, which would defeat the purpose of the cache in the first place!
Detailed proposal
Look into memcached and Redis docs and figure out which API calls are used to invalidate a key, and call them in the individual clients. Then export that functionality from src/lib/cache.js. We need to come up with a good name...
invalidate
invalidateKey
clearKey
resetKey
clearCacheKey
resetCacheKey
Are you interested in working on this?
I'm interested in working on this
The text was updated successfully, but these errors were encountered:
Summary
Although Service Caching was built to sort of mirror the Rails implementation of caching (which is, of course, perfect), there could be cases where you want to invalidate a key manually, rather than always trying to come up with a unique key. For example, if calling an
updatePost
service function, invalidate the key created in thepost
function.Motivation
We gave a demo of Service Caching during office hours in Discord and @dthyresson brought up the idea of invalidating an existing key, specifically for a weird issue that came up with caching a post by it's
id
only, not including anupdatedAt
timestamp. There'd be no way to bust that cache, and actually trying to get theupdatedAt
stamp would mean we'd have to query the post to get it, which would defeat the purpose of the cache in the first place!Detailed proposal
Look into memcached and Redis docs and figure out which API calls are used to invalidate a key, and call them in the individual clients. Then export that functionality from
src/lib/cache.js
. We need to come up with a good name...invalidate
invalidateKey
clearKey
resetKey
clearCacheKey
resetCacheKey
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: