Difference between no-cache and must-revalidate

前端 未结 4 957
时光说笑
时光说笑 2020-11-28 17:50

From the RFC 2616

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1

no-cache

If the no-cache directive does not spe

4条回答
  •  [愿得一人]
    2020-11-28 18:37

    max-age=0, must-revalidate and no-cache aren't exactly identical. With must-revalidate, if the server doesn't respond to a revalidation request, the browser/proxy is supposed to return a 504 error. With no-cache, it would just show the cached content, which would be probably preferred by the user (better to have something stale than nothing at all). This is why must-revalidate is intended for critical transactions only.

提交回复
热议问题