摘自Flight PHP微框架网站:
HTTP Caching
Flight provides built-in support for HTTP level caching. If the caching condition is met, Flight will return an HTTP 304 Not Modified response. The next time the client requests the same resource, they will be prompted to use their locally cached version
我设法安装了框架并开始使用它。
作为 PHP n00b,欢迎任何关于 HTTP 级缓存
的解释。 缓存条件
的扩展也很好。
提前致谢。
最佳答案
“HTTP 级缓存”简单来说就是“HTTP 级缓存”,即通过 HTTP header (例如 Cache-Control
、Expires
、If-修改时间
)。这些 header 可以由服务器或客户端设置。
客户端可以设置缓存条件,例如 If-Modified-Since
,以便仅在其缓存副本过期时获取更新的内容。服务器看到 If-Modified-Since
并将客户端的日期与资源上的日期进行比较;如果资源较新,则提供。否则,服务器会返回一个小的 304 Not Modified
响应,以通知客户端自上次请求以来没有任何变化。
关于http - 请求 <HTTP 级缓存> 解释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12471797/