sstephenson/sprockets — pull request #535 by josh (2014-03-10 21:14:03+00:00)
Title: LRU Cache Store requirement

For 3.0, I want to make a backwards incompatible change and require that `environment.cache` be assigned to a LRU cache store. Technically, a non-LRU cache still will work, just that it might end up being filled with trash after some usage.

Currently, Sprockets conservatively reuses cache keys for the same assets to avoid increasing the size of its cache. Mainly to support the file store cache which is the most common and recommended persisted store. Even so, the file store ends up increasing a little and is prone is cache thrashing. @tmm1 and I hit this recently as an issue with CI builds rerunning over the same FS and thrashing with caches from other branches. It'd be nice if a few revisions of caches could hang out for this case and faster deployment rollbacks.

I'm mostly asking for help reviewing the File Store LRU implementation. Its a bit tricky to get correct and its going to be the store most people use.

I'm also open to using an existing pluggable cache store backend if someone knows a good one. Unfortunately I can't use anything from ActiveSupport.

/cc @tenderlove @tmm1 @mislav @guilleiguaran @dgraham