Cloudflare 正在缓存我的请求,但它忽略了语言 header 。
示例请求:
URL :
https://api.example.com/v1/places/?param=1¶m=2
Header :
Accept-Language : en
但不管怎样Accept-Language
值是,第一个命中具有尊重的 header (例如)en
, 当我用另一种语言再次提出相同的请求时,说 ar
,它再次加载英语(第一语言)...我怎样才能让 Cloudflare 尊重所有语言的语言(每个不同的值),以便 Cloudflare 为不同的语言创建一个条目。
或者唯一的解决方案是将语言添加为查询参数?
PS:这是我正在使用的页面规则。
Browser Cache TTL: 30 minutes, Cache Level: Cache Everything, Edge Cache TTL: a month
最佳答案
他们通过企业计划上的页面规则支持自定义缓存键。
https://support.cloudflare.com/hc/en-us/articles/115004290387-Using-Custom-Cache-Keys
关于web - 尊重 cloudflare 中的语言标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63713610/