asset_symlink
asset_symlink copied to clipboard
Cache-control header for symlinked assets is far out
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".
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)