当我使用curl命令时,所有的头文件都是正确的,但是文件没有缓存为
CF缓存-状态:未命中
由curl命令显示。
> < HTTP/1.1 200 OK < Date: Sat, 02 Jun 2018 05:57:28 GMT <
> Content-Type: image/png < Content-Length: 2293 < Connection:
> keep-alive < Set-Cookie:
> __cfduid=d3cf179afd212660124585350d19e88c81527919048; expires=Sun, 02-Jun-19 05:57:28 GMT; path=/; domain=.mayan.cf; HttpOnly <
> X-Powered-By: Express < Accept-Ranges: bytes < Cache-Control: public,
> max-age=86400 < Last-Modified: Fri, 01 Jun 2018 15:39:06 GMT < ETag:
> W/"8f5-163bc009a0c" < CF-Cache-Status: MISS < Expires: Sun, 03 Jun
> 2018 05:57:28 GMT < Server: cloudflare < CF-RAY: 4247aec4300930f6-SIN
> < { [1905 bytes data]
> * Connection #0 to host mayan.cf left intact
发布于 2018-06-03 01:03:43
Cloudflare使用一些启发式方法来尝试根据请求来猜测内容是静态的(可缓存的)还是动态的。如果它在请求时猜错了,它就不会缓存响应。您可以通过将页面规则"Cache Level“设置为"Cache Everything”来禁用此启发式方法--然后Cloudflare将假定响应总是可缓存的。
尝试设置该页面规则,看看是否有帮助。
发布于 2018-06-02 14:40:31
如果缓存控制标头设置为"private“、"no-store”、"no-cache“、”“或"max-age=0",或者如果响应中有cookie年龄,则Cloudflare将不缓存该资源。
https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-Cloudflare-What-to-Cache-
https://stackoverflow.com/questions/50654012
复制相似问题