Given that Heroku Kedra does not have http caching provided by Varnish, I would like to use Rack::Cache . I was told that in rails 3.1.1 Rack::Cache active by default, I just need to make sure the configuration:
config.action_controller.perform_caching = true
and I need to select cache storage, for this experiment I use:
config.cache_store = :memory_store
In the action of the page I want to cache, I added the following lines:
response.header['Cache-Control'] = 'public, max-age=300' response.header['Expires'] = CGI.rfc1123_date(Time.now + 300)
This code is used to work with varnish, the first request returns 200, and the next (within 5 minutes) returns 304 .
This does not happen with Rails 3.1 and Heroku Cedar Stack. I get these headers in the response, but subsequent requests return 200 instead of 304.
What am I doing wrong? Thanks.
soulnafein
source share