Add ActiveSupport::Cache::NullStore for testing and development #3954

merged 1 commit into from Dec 12, 2011


None yet
4 participants

bdurand commented Dec 12, 2011

This patch provides a NullStore implementation of ActiveSupport::Cache::Store suitable for use in development and test environments where the code needs to use the cache interface, but actually caching data is not desired.

The cache store will never store data itself. It does implement the LocalCache strategy which will store values for the duration of a request to match the behavior of other cache implementations used in production environments.

It would be used then in the development.rb, for example, as:

config.cache_store = :null

(Note: this request was originally opened in Lighthouse at

Brian Durand Add ActiveSupport::Cache::NullStore to expose caching interface witho…
…ut actually caching for development and test environments.

@josevalim josevalim added a commit that referenced this pull request Dec 12, 2011

@josevalim josevalim Merge pull request #3954 from bdurand/null_store_2
Add ActiveSupport::Cache::NullStore for testing and development

@josevalim josevalim merged commit ffa8bfe into rails:master Dec 12, 2011


josevalim commented Dec 12, 2011

Merged, thanks a lot.


jeremy commented Dec 12, 2011

Nice! 👍


javan commented Dec 20, 2011

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment