asset_symlink icon indicating copy to clipboard operation
asset_symlink copied to clipboard

Cache-control header for symlinked assets is far out

Open dylanjha opened this issue 6 years ago • 1 comments

For symlinked assets the cache control header is:

cache-control: public, max-age=14400

This is the same header used for the non-symlinked asset.

I'm sure this is the intended behavior, but I can imagine that for some use cases you would want the symlinked assed to have a shorter cache expiration so that if the source JS file is changed, clients will download the new code.

Following the example in the README, if you distribute a "widget.js" asset to clients, and then push a bugfix to widget.js, CDNs & browser that already have the old asset cached will not download the code that has the bugfix.

Is there any known way around this? I can't seem to find a way to change the cache-control header for only "symlinked assets".

dylanjha avatar Jul 05 '18 21:07 dylanjha

what is setting the header? The way I serve my assets (via apache) I have rules setting the expiry time of things in assets/ and as you say it’s usually a good thing to use a lower expiry time for these than for files with digests in their name

I don’t think there is anything this gem is doing that has any impact on what caching headers are being set (but I would love to be proven wrong)

fcheung avatar Jul 06 '18 06:07 fcheung