Rails Caching Stores_Ruby_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > Ruby > Rails Caching Stores

Rails Caching Stores

 2012/6/29 16:37:33  t284299773  程序员俱乐部  我要评论(0)
  • 摘要:粘贴至RailsAPICachingstoresAllthecachingstoresfromActiveSupport::CacheareavailabletobeusedasbackendsforActionControllercaching.Thissettingonlyaffectsactionandfragmentcachingaspagecachingisalwayswrittentodisk.Configurationexamples
  • 标签:rails

粘贴至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缓存和片段缓存

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

发表评论
用户名: 匿名