Cloudflare 缓存的东西没有 Cache-Control 并且默认过期 header

Cloudflare cached things without Cache-Control and Expires header by default

来自doc

Cloudflare caches the resource in the following scenarios:

  • The Cache-Control header is set to public and the max-age is greater than 0.
  • The Expires header is set to a future date.

但我发现它缓存了我的 js 文件,即使我的 nginx 服务器没有发送任何 Cache-Control 并且过期 header。

Cloudflare caches the resource in the following scenarios:

这是第一段关于此 page 的带项目符号的声明,正如本段开头所解释的,适用于服务器发送 header 的情况。

换句话说,当您的服务器提供 header 的 non-default 案例时,Cloudflare 根据第一个中指定的项目符号点处理 header段.

But I find it cached my js files

当没有 header 时(您说的是 “我的 nginx 服务器不发送任何 Cache-Control 并且过期 header” ) 那么这是默认情况,并且适用相同 page 的第二段。它说 .JS 文件默认被缓存。