Caching Rails pages expires_in

Will a line below work in an arbitrary Rails controller?

caches_page :show, :expires_in => 1.days 

I use memcached, but I'm confused about how page caching works. Does it use a file system or put pages in memory with memcached?

EDIT: it looks like it will use the file system. So, is there a simple way to automatically free the page from the cache after a specified time or do I need to write a sweeper?

+4
source share
1 answer

The Rails cache method depends on your settings in the application.

Check the config/environments directory files for the config.cache_store parameter.

Official Rail Caching Guides: http://guides.rubyonrails.org/caching_with_rails.html

+3
source

Source: https://habr.com/ru/post/1432708/


All Articles