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
On static content with versioned URLs, add a flag to options on express.static that generates a cache-control header with immutable, e.g.: Cache-Control: max-age=365000000, immutable
This reduces unnecessary requests in supporting clients.
Sounds reasonable :) One point missed above is that Chrome does not support this, as you can read through in that Chromium issue (they implement something similar to cache-control: immutable using heuristics instead of looking at a header value at all).
Thinking how we could easily add this to our API, what about having it where if you set maxAge: Infinity it would add the immutable tag in addition to the 1 year age it does today?
On static content with versioned URLs, add a flag to options on express.static that generates a cache-control header with immutable, e.g.:
Cache-Control: max-age=365000000, immutable
This reduces unnecessary requests in supporting clients.
This is supported by Firefox 49 and used by Facebook:
https://hacks.mozilla.org/2017/01/using-immutable-caching-to-speed-up-the-web/
https://bitsup.blogspot.co.uk/2016/05/cache-control-immutable.html
Supported in Chrome 54
https://bugs.chromium.org/p/chromium/issues/detail?id=611416
Webkit support seems to be added:
https://bugs.webkit.org/show_bug.cgi?id=167497
The text was updated successfully, but these errors were encountered: