Rails config.static_cache_control how to exclude files from cache

I set long term heading expiration in all my assets. However, in my public directory there are static HTML files (for the Jekyll blog) that are cached, and there are none when updating. This is actually just my main index.html file, located in app/public/blog , which continues to hit the cache.

Is it as simple as changing the "public" in the config?

config.static_cache_control = "public, max-age=604800"

+4
source share
1 answer

I know this is an old question, but I always find it when I look at it (I look at it all the time), so here is the answer:

No, publishing to config.static_cache_control NOT a public / directory rail.

In fact, this entire line is a literal used as a Cache-Control header when serving static assets (including both public and copied compiled assets in assets /).

See http://guides.rubyonrails.org/asset_pipeline.html#cdns-and-the-cache-control-header to find out how config.static_cache_control is used on rails and http://www.w3.org/Protocols/ rfc2616 / rfc2616-sec14.html # sec14.9 for w3c documents by Cache-Control header value.

+3
source

All Articles