cache-control immutable
See original GitHub issueI am no expert but I see immutable on everything now. I believe adding cache-control immutable would improve performance. Apparently even with max age set, browsers will revalidate on a page reload and immutable helps stop that from happening: https://www.keycdn.com/blog/cache-control-immutable
Expected behaviour
responses should be cache-control: max-age=31536000,public,immutable
Actual behaviour
responses are cache-control: max-age=31536000,public
I don’t think there is any harm in setting it if public and max-age > 0.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Improving Performance with Cache-Control: immutable
Cache-Control : immutable is an extension directive that prevents browsers from performing redundant conditional revalidation on static ...
Read more >Cache-Control - HTTP - MDN Web Docs
immutable tells a cache that the response is immutable while it's fresh and avoids those kinds of unnecessary conditional requests to the server ......
Read more >Cache-control Immutable Header - Stack Overflow
When a client supporting immutable sees this attribute it should assume that the resource, if unexpired, is unchanged on the server and ...
Read more >headers HTTP header: Cache-Control: `immutable` - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >1 critical thing you need to know when using immutable caching
Headers sent by the server tell the browser if the content should be cached or should not be. This header, 'Cache-Control' can have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This seems like a useful feature.
@caeugusmao Thanks for the nginx tip. I think that is a great suggestion for everyone until it it is officially supported. I am adding it using the following commands:
(I am no nginx expert and there is likely a better way to append immutable to the existing header but I found it easiest to hide the current one and add the new one to avoid duplicate)
Yes, if it is something you would want I will send a PR eventually. I wouldn’t be sad if one of you beat me to adding the “, immutable” to the cache string if you happen to be in the code area though.