You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which is a cache-control extension implemented already in firefox. I think this is reasonable, as you already set a large cache expiration date Cache-Control: public, max-age=30672000
This could help reducing calls to the server resulting in 304 not-modified and thereby also reduce some privacy issues (less requests - less traceability)...
I don't think we should implement it until I change the backend to reduce the update failures we have from time to time (and, perhaps, officially supporting "latest")
Hi @terinjokes, I think it'll be great to enable it no matter it the backend on Cloudflare side changes as this can really help improve performance by reducing the cache validation, am I right?
@PeterDaveHello Chrome still does not have this implemented, should I raise this to Cf to ask them to set Cache control to be immutable when a Firefox UA is detected?
Chrome's dev tools should show if the resource was fetched from cache or not, but I'm not sure of any way to really confirm how long it's planning to hold the resource for in cache.
Activity
drewfreyling commentedon Aug 2, 2016
This is a good idea but might not be of real benefit until it is supported by more browsers as it is just a bunch of wasted bytes unless you use a recent version of Firefox.
Chrome doesn't seem to be in a hurry - https://bugs.chromium.org/p/chromium/issues/detail?id=611416
PeterDaveHello commentedon Aug 3, 2016
cc @cdnjs/owners @terinjokes
terinjokes commentedon Aug 9, 2016
This looks pretty cool.
I don't think we should implement it until I change the backend to reduce the update failures we have from time to time (and, perhaps, officially supporting "latest")
dima74 commentedon May 1, 2017
Hello! What about adding
Cache-Control: immutableonly when user-agent is Firefox?PeterDaveHello commentedon May 21, 2017
Hi @terinjokes, I think it'll be great to enable it no matter it the backend on Cloudflare side changes as this can really help improve performance by reducing the cache validation, am I right?
MattIPv4 commentedon Mar 2, 2019
@PeterDaveHello Chrome still does not have this implemented, should I raise this to Cf to ask them to set Cache control to be immutable when a Firefox UA is detected?
MatthewSteeples commentedon Apr 25, 2019
Everyone apart from Chrome (and probable IE) implement this now
MattIPv4 commentedon Apr 25, 2019
@MatthewSteeples Yeah, I think it best we implement it as it should improve performance. I will contact Cf and post any updates here :)
MattIPv4 commentedon Apr 6, 2020
@xtuc would you be able to help with getting this added?
xtuc commentedon Apr 6, 2020
According to https://caniuse.com/#feat=mdn-http_headers_cache-control_immutable the support is pretty low
MattIPv4 commentedon Apr 6, 2020
Currently, we send
cache-control: public, max-age=30672000. Looking at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#Caching_static_assets it should be safe to append, immutable.https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#Extension_Cache-Control_directives notes that if a UA doesn't recognize
immutable, it should just be ignored, so it'd fall back to the long max-age we are sending.(I'm no expert on this though)
xtuc commentedon Apr 6, 2020
@MattIPv4 that sound right. I sent the header to my Chrome and it didn't fail. That said, I'm not sure how to check that it works
MattIPv4 commentedon Apr 6, 2020
@xtuc Simple. Just wait a year and see if it expires. /s
MattIPv4 commentedon Apr 6, 2020
Chrome's dev tools should show if the resource was fetched from cache or not, but I'm not sure of any way to really confirm how long it's planning to hold the resource for in cache.