[英]How to set cache-control to always check for updates but always fall back to cache if server is unreachable
I'm missing something trying to understand cache-control (eg, from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control ).我遗漏了一些试图理解缓存控制的东西(例如,来自https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control )。
How do I set up cache control to accomplish the following (I'll be using an .htaccess file):如何设置缓存控制以完成以下操作(我将使用 .htaccess 文件):
Use Cache-Control: no-cache
and set the ETag
header.使用
Cache-Control: no-cache
并设置ETag
header。
no-store
.no-store
之外的任何缓存 header 都是如此。no-cache
tells the client that it must check with the server to see if the cached copy is valid. no-cache
告诉客户端它必须检查服务器以查看缓存的副本是否有效。 It does this by sending a conditional request, which requires that the cached response have an ETag
(or Last-Modified
) header.ETag
(或Last-Modified
)header。must-revalidate
directive.must-revalidate
指令来防止这种情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.