Warm tip: This article is reproduced from stackoverflow.com, please click
cache-control caching header http-headers

Cache-control Immutable Header

发布于 2020-06-24 16:18:14

I was reading about immutable header and i came across with this article saying that:

Cache-Control: max-age=365000000, immutable

When a client supporting immutable sees this attribute it should assume that the resource, if unexpired, is unchanged on the server and therefore should not send a conditional revalidation for it (e.g. If-None-Match or If-Modified-Since) to check for updates. Correcting possible corruption (e.g. shift reload in Firefox) never uses conditional revalidation and still makes sense to do with immutable objects if you're concerned they are corrupted.

source

I cant understand this phrase "if unexpired, is unchanged on the server and therefore should not send a conditional revalidation"

Client, by default doesnt send a revalidation until the max-age is expired.

So whats the point define immutable in the first place?

Questioner
George Paouris
Viewed
41
Barry Pollard 2020-04-06 13:42

People pressing the refresh button.

Facebook, who first proposed this immutable cache-control directive, have a good post on this about how it saved them a huge amount of requests, including this quote:

The problem with reloads

The browser’s reload button exists to allow the user to get an updated version of the current page. In order to meet this goal, when you reload, browsers revalidate the page that you are currently on, even if that page hasn’t expired yet. However, they also go a step further and revalidate all sub-resources on the page — things like images and JavaScript files.