Type:
Class
Constants:
PER_ENTRY_OVERHEAD : 240

A cache store implementation which stores everything into memory in the same process. If you're running multiple Ruby on Rails server processes (which is the case if you're using mongrel_cluster or Phusion Passenger), then this means that Rails server process instances won't be able to share cache data with each other and this may not be the most appropriate cache in that scenario.

This cache has a bounded size specified by the :size options to the initializer (default is 32Mb). When the cache exceeds the allotted size, a cleanup will occur which tries to prune the cache down to three quarters of the maximum size by removing the least recently used entries.

MemoryStore is thread-safe.

decrement
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

decrement(name, amount = 1, options = nil) Instance Public methods Decrement

2025-01-10 15:47:30
cached_size
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

cached_size(key, entry) Instance Protected methods

2025-01-10 15:47:30
clear
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

clear(options = nil) Instance Public methods

2025-01-10 15:47:30
cleanup
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

cleanup(options = nil) Instance Public methods Preemptively iterates through

2025-01-10 15:47:30
increment
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

increment(name, amount = 1, options = nil) Instance Public methods Increment

2025-01-10 15:47:30
new
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

new(options = nil) Class Public methods

2025-01-10 15:47:30
pruning?
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

pruning?() Instance Public methods Returns true if the cache is currently being

2025-01-10 15:47:30
prune
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

prune(target_size, max_time = nil) Instance Public methods To ensure entries

2025-01-10 15:47:30
delete_matched
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Cache/ActiveSupport::Cache::MemoryStore

delete_matched(matcher, options = nil) Instance Public methods

2025-01-10 15:47:30