Re:IdentityCache: Improving Performance one Cached Model at ...
by camilolopez on Thursday April 04, 2013 @06:58PM
(#5495840)
The way schema migrations are handled is by making a hash of the current schema part of the cache key, so yeah, effectively every time a cached model's underlying table schema is changed all the cached entries become invalid.
The reason I ask is because in the .NET/NHibernate world, this is akin to a 2nd level cache provider. I maintain a Redis caching provider for NHibernate (https://github.com/TheCloudlessSky/NHibernate.Caches.Redis) and I've been trying to find a decent solution to this problem. When NHibernate fetches a cached model with mismatching columns etc, it'll blows up with an exception.
I like the generational approach that is part of Rails 4 but it really only works for the views. Maybe incorporating some sort of generational identity of the model's configuration could be used for cache busting?