2 个回答

If none of the entity tags match, then the server MAY perform the requested method as if the If-None-Match header field did not exist, but MUST also ignore any If-Modified-Since header field(s) in the request. That is, if no entity tags match, then the server MUST NOT return a 304 (Not Modified) response.

详情见
https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html 14.26 If-None-Match

根据 RFC 规范 13.3.4

If both an entity tag and a Last-Modified value have been
provided by the origin server, SHOULD use both validators in
cache-conditional requests. This allows both HTTP/1.0 and
HTTP/1.1 caches to respond appropriately.

这意味着:如果 Last-Modified 和 ETag 同时被使用,则要求它们的验证都必须通过才会返回 304,若其中某个验证没通过,则服务器会按常规返回资源实体及 200 状态码。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏