rails/rails — pull request #8317 by latortuga (2012-11-26 04:09:29+00:00)
Title: Add explicit opt-out for fragment cache digesting

This add support for sending an explicit opt-out of the "Russian-doll" cache digest feature on a case-by-case basis. This is useful when cache-expiration needs to be performed manually and it would be otherwise difficult to know the exact name of a digested cache key.

@dhh requested I submit this PR, more information can be found here: https://github.com/rails/cache_digests/pull/16

Note that the cache_digests gem also checks to see if a cache fragment is explicitly versioned using the following heuristic:

1. The cache key is an array
2. The first item in that array is in the format of "v{digits}" (e.g. ["v2",project] would be considered explicitly versioned)

I have **not** added support for this feature in this PR but I can add it fairly easily if you would like it. Adding the "explicitly versioned key" check would bring the rails master functionality in-line with gem's behavior.