Forum: Ruby on Rails caching: fresh_when unless dev

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Igor A. (Guest)
on 2014-12-25 18:45
Is there any way to disable HTTP caching when in DEV?

The best I figured out for now is overriding fresh_when method like

def fresh_when
    super(yield) unless ENV['RAILS_ENV'] == 'development'

and in controllers it looks:

fresh_when do
      max_created_at = # for instance
      {last_modified: max_created_at.utc, etag:

PS Sorry but I couldn't find the way to define code block here
This topic is locked and can not be replied to.