Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fragment Caching with Memcached

Is there any way of using Memcached for fragment caching in Rails?

like image 614
Codebeef Avatar asked Jan 25 '23 00:01

Codebeef


2 Answers

you can add this to your development.rb and it should do fragment caching as well as the others

config.action_controller.perform_caching = true
config.cache_classes = true
config.cache_store = :mem_cache_store
like image 174
Brian Armstrong Avatar answered Jan 31 '23 06:01

Brian Armstrong


You can set the fragment_cache_store in your environment.rb

  ActionController::Base.cache_store = ActiveSupport::Cache::MemCacheStore.new()

http://api.rubyonrails.org/classes/ActionController/Caching.html#M000628

like image 44
TonyLa Avatar answered Jan 31 '23 06:01

TonyLa