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

Merged
merged 1 commit into from Dec 12, 2011

Conversation

Projects
None yet
4 participants
Contributor

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 https://rails.lighthouseapp.com/projects/8994/tickets/6128)

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

@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
ffa8bfe

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

Member

josevalim commented Dec 12, 2011

Merged, thanks a lot.

Owner

jeremy commented Dec 12, 2011

Nice! 👍

Member

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