module AbstractController::Caching::Fragments::ClassMethods
def fragment_cache_key(value = nil, &key)
end
@account.id.odd? ? "v1" : "v2"
fragment_cache_key do
class ApplicationController
invalidation using a computed value:
the string constant. Or, progressively roll out the cache
When it's time to invalidate all fragments, simply change
end
fragment_cache_key "v1"
class ApplicationController
invalidate all caches.
with a global version identifier, so you can easily
For example, you may want to prefix all fragment cache keys
which computes a value each time a cache key is generated.
cache fragments. Pass either a constant +value+, or a block
Allows you to specify controller-wide key prefixes for
def fragment_cache_key(value = nil, &key) self.fragment_cache_keys += [key || -> { value }] end