Memcachedを使用したフラグメントキャッシュ
-
06-07-2019 - |
質問
MemcachedをRailsのフラグメントキャッシュに使用する方法はありますか?
解決
environment.rbでfragment_cache_storeを設定できます
ActionController::Base.cache_store = ActiveSupport::Cache::MemCacheStore.new()
http://api.rubyonrails.org/classes/ActionController/Caching .html#M000628
他のヒント
これをdevelopment.rbに追加すると、他のフラグメントと同様にフラグメントキャッシングを行う必要があります
config.action_controller.perform_caching = true
config.cache_classes = true
config.cache_store = :mem_cache_store
所属していません StackOverflow