我正在使用 CloudflareWorkers 来处理地球图像请求,并想使用 Cloudflare 的缓存来避免过多不必要的Workers请求刷爆我的账单。我在 Worker 中设置最新图片的缓存头
return new Response(imageResponse.body, {
headers: {
'Content-Type': 'image/png',
'Cache-Control': 'public, max-age=300, s-maxage=600'
}
});
但我实际打开发现Cloudflare并没有缓存我的图片,并且我每一次刷新都发送给了Workers处理,我在F12中发现缺失cf-cache-status
字段:
我尝试过设置Cloudflare Cache Rules、将访问改成访问earth.png,但Cloudflare就是不缓存图片,就是没有
cf-cache-status
字段,请问有没有大佬知道是我哪里配置错了吗?我的后端地址https://earth.100713.xyz/,
https://earth.100713.xyz/time?date=2018-09-01&time=12:00:00