While debugging a production issue we cleared the redis cache for multiple keys related to the users table and VACOLS queries. We had to enter the production console and manually run Rails.cache.delete({{KEY}}) for several cached queries. Since we also store feature toggles and functions in the redis cache running Rails.cache.clear would have cleared those. In order to clear all transient cached keys (like these users and VACOLS) we should create a convenience method to clear the keys during incident investigations like these.
Might be nice to group cache keys by the resource they front (VACOLS, BGS, etc) so that we could call something like: Rails.cache.clear(:vacols) and it would Do The Right Thing.
Probably also useful as an audit of all the ways/places we are caching stuff.
cm = CacheManager.new
cm.clear(:vacols)
example of clearing all the VACOLS-related caches.
Most helpful comment
Might be nice to group cache keys by the resource they front (VACOLS, BGS, etc) so that we could call something like:
Rails.cache.clear(:vacols)and it would Do The Right Thing.Probably also useful as an audit of all the ways/places we are caching stuff.