Turn on active record cache_versioning#1149
Conversation
This keeps the version seperate from Rails standard cache_key, which allows for better recycling of cached entries as things get updated freqently. This shouldn't impact our app right now, as we are only using our own manual cache keys for analytics. For more details on how recyclable cache keys work, see: * rails/rails#29092 * https://dzone.com/articles/cache-invalidation-complexity-rails-52-and-dalli-c
vkrmis
left a comment
There was a problem hiding this comment.
Are we doing this in preparation for Dashboard work?
Also, can we turn this on seamlessly or do we need to do some prep work before we can do this safely? (eg: flush existing cache)
Yup.
It is seamless, none of our existing cache usage will be impacted by this. All our existing cache usage uses our own manually constructed keys: |
|
If I understand This also sort of effectively changes the definition of a "cache miss" from a redis PoV, but from a rails perspective an unmatched version fetch would be a miss if I'm getting this right. |
Yup, it essentially separates out the cache version from the key. So your entries are stored under the cache_key only, and then the version is inside the cached entry itself...so the version can be compared and old entries can be removed from the cache if there is a newer entry on a |
This keeps the version seperate from Rails standard cache_key, which
allows for better recycling of cached entries as things get updated
freqently. This shouldn't impact our app right now, as we are only
using our own manual cache keys for analytics.
For more details on how recyclable cache keys work, see: