An abstract cache store class. There are multiple cache store implementations, each having its own additional features. See the classes under the ActiveSupport::Cache module, e.g. ActiveSupport::Cache::MemCacheStore. MemCacheStore is currently the most popular cache store for large production websites.

ActiveSupport::Cache::Store is meant for caching strings. Some cache store implementations, like MemoryStore, are able to cache arbitrary Ruby objects, but don’t count on every cache store to be able to do that.

  cache = ActiveSupport::Cache::MemoryStore.new

  cache.read("city")   # => nil
  cache.write("city", "Duckburgh")
  cache.read("city")   # => "Duckburgh"


  • silence
  • logger_off
Show files where this class is defined (1 file)
Register or log in to add new notes.