Heroku action caching doesn't seem to work

I play with various caching strategies on Heroku and add their memcached add-on to add action caching to my application.

When I look at Rails.cache.stats in my current application, however (with memcached installed and using dalli gem), I get the current and total_items at 0 after performing actions that should be cached.

At the top of the controller with the action I want to cache, I have:

caches_action :show 

In addition, I changed the configuration of my environment (for the one that works on Heroku) so that

 config.cache_store = :dalli_store 

Are there any other statistics that I can look at, does it work or is something wrong?

+6
source share
1 answer

You need to enable caching, as well as configure cache storage:

 config.action_controller.perform_caching = true 
+2
source

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


All Articles