Enable image caching in development mode in Rails 3.1 Enable image caching in development mode in Rails 3.1 google-chrome google-chrome

Enable image caching in development mode in Rails 3.1


The only way I've seen to manipulate the Cache-Control header for assets is by configuring static assets with:

config.serve_static_assets = trueconfig.static_cache_control = "public, max-age=3600"


http://code.google.com/p/chromium/issues/detail?id=102706

This seems to be a documented issue with chrome. I'm suffering from the same problem: Adding or removing a CSS class that references an image will flash or resize while the image request (which will always return a 304 not modified) is underway.


Sprockets is either going to send caching headers or force revalidation (see the source).

I can see no publicly available options to change this behavior.

To modify this I think you will have to monkey patch Sprockets.

Possibly of greater interest is why Chrome is behaving in that way?