Re: [whatwg/fetch] {cache: "no-cache"} vs Cache-Control: immutable (#308)

"no-cache" fetch mode is the same thing as reload (F5), Gecko code reference [1][2][3].  C-c: immutable was specifically crafted for this case - to not revalidate on plain F5.  Hence, I agree with @wanderview that "no-cache" fetch mode should special-case immutable resources and not do revalidation _at all_ for them.  Immutable is an optimization.  If it needs to be overruled, "reload" fetch mode can be used, but what for when the resource on the server is expected to be always the same as the one we have already cached before?  In other words, for immutable resources the validation is expected to always pass, so it can be freely skipped.

Note that immutable is something web admins have to use with some level of caution.  It does exactly what it says hence it has to be used only on resources that are actually not changing during their entire lifetime to not confuse users reloading their pages.

However, final word should come from @mcmanus, the father of cc: immutable.

[1] https://dxr.mozilla.org/mozilla-central/rev/0bb0f14672fdda31c19aea1ed829e050d693b9af/netwerk/protocol/http/HttpBaseChannel.cpp#2843
[2] https://dxr.mozilla.org/mozilla-central/rev/0bb0f14672fdda31c19aea1ed829e050d693b9af/netwerk/protocol/http/nsHttp.cpp#371
[3] https://dxr.mozilla.org/mozilla-central/rev/0bb0f14672fdda31c19aea1ed829e050d693b9af/docshell/base/nsDocShell.cpp#11788


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/308#issuecomment-346831228

Received on Friday, 24 November 2017 13:42:08 UTC