0

我在https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since上阅读:

# If-Modified-Since
If the resource has not been modified since, the response will be a 304 without any body;

所以我处理一个 API 调用,比如说https://en.vikidia.org/wiki/Computer

# Request
GET /wiki/Batman HTTP/2
Host: en.vikidia.org
Referer: https://duckduckgo.com/

If-Modified-Since: Wed, 19 May 2021 12:55:57 GMT
[...]
# Response
scheme: https
host: en.vikidia.org
filename: /wiki/Batman
Adress: 104.21.15.203:443
Version: HTTP/2
Transfert: 7.67 Ko (size 23.64 Ko)
Referer: https://duckduckgo.com/

Status: 304 Not Modified
[...]

# Response header
last-modified: Wed, 19 May 2021 12:55:57 GMT

问题:

  • 为什么我会同时收到数据和304代码状态?这似乎合乎逻辑,但也似乎违反规范(见上面的链接)
  • 为什么Wed, 19 May 2021 12:55:57 GMT具体?谁请求了这个特定日期(duckduckgo?因为我在直接从 Vikidia 请求页面时没有 If-Modified-Since 标签)?
4

0 回答 0