Page cache is not expiring

2

I'm using caches_page in a controller in my rails 4 application.

caches_page :index, expires_in: 10.minutes

I need to make this controller run again after 10 minutes and generate a new page. When I squeeze this in the production environment after 10 minutes the page is not expired.

I'm using the: memory_store in my config

  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.cache_store = :memory_store

How can I resolve this?

Thank you!

    
asked by anonymous 25.06.2016 / 02:10

1 answer

1

I found out what the problem is. The expires_in only works if you are using Memcached or something similar (like Redis, for example).

It still only works in caches_action. The caches_page is made for pages that will never be changed or manually run the expires_page ('/ route') controller.

Source: link

    
25.06.2016 / 17:33