Rails Caching Stores

粘贴至Rails API

Caching stores

All the caching stores from ActiveSupport::Cache are available to be used as backends for Action Controller caching. This setting only affects action and fragment caching as page caching is always written to disk.

Configuration examples (MemoryStore is the default):

config.action_controller.cache_store = :memory_store
config.action_controller.cache_store = :file_store, "/path/to/cache/directory"
config.action_controller.cache_store = :mem_cache_store, "localhost"
config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new("localhost:11211")
config.action_controller.cache_store = MyOwnStore.new("parameter")

 

请注意:设置

config.action_controller.cache_store = :mem_cache_store

 只针对

action and fragment caching #action缓存和片段缓存

 有效,页面缓存是会存入磁盘的!!!

你可能感兴趣的:(Ruby,Rails)