无法绕过 Cloudflare 中 API 的动态状态缓存

Cannot bypass Dynamic status cache for my APIs in Cloudflare

定义以下配置以避免 API 的动态缓存后:Cloudflare for your API

我的调用仍处于动态缓存状态。可以看到收到的回复 headers :

access-control-allow-methods: GET,OPTIONS
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; ma=86400
cache-control: no-cache, no-store, max-age=0, must-revalidate
cf-cache-status: DYNAMIC
cf-ray: 698eeac5ae5640cf-CDG
client-control: max-age=43200, s-max-age=43200
content-encoding: br
content-type: application/json
date: Mon, 04 Oct 2021 13:57:03 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
expires: 0
pragma: no-cache
server: cloudflare
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers, Accept-Encoding
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 1; mode=block

这是我完成的配置

你有没有办法得到一个 'BYPASS' 缓存 Clouflare Status Headers

如果您的目标是避免缓存 API 调用,那么上述页面规则看起来是正确的。您正在对 Bypass 缓存逻辑使用 Cache Level 指令。

这意味着所有匹配 URL 模式的调用都将始终从您的源服务器中提取。价值 DYNAMIC

cf-cache-status 响应 header 证实了这一点

来自documentation

DYNAMIC: Cloudflare does not consider the asset eligible to cache and your Cloudflare settings do not explicitly instruct Cloudflare to cache the asset. Instead, the asset was requested from the origin web server.

响应headercf-cache-status也可以有BYPASS的值,但这发生在其他场景中(也在文档中描述)