V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lxyer1
V2EX  ›  程序员

诡异的问题, cf 设置的缓存规则不生效

  •  
  •   lxyer1 · 285 天前 · 822 次点击
    这是一个创建于 285 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我的网站设置了 cf 的缓存,但是不想让 cf 缓存 api 接口的数据,我如图配置后,https://chat.xxxhao.info/api/auth/getInfo 这个 get 接口的信息还是走的 cf 的缓存,弄了两天都没有弄好,来请教大佬了,

    response header 中看还是命中缓存了

    server: cloudflare vary: Accept-Encoding x-cache: HIT x-powered-by: Express

    2 条回复    2023-07-18 16:43:22 +08:00
    MoeWang
        1
    MoeWang  
       285 天前 via iPhone   ❤️ 1
    x-cache 不是 cloudflare 的缓存标识,你需要检查你自己 web 服务器的缓存,cloudflare 的缓存标头有且只有 cf-cache-status

    建议查看:
    https://community.cloudflare.com/t/what-does-x-cache-header-hit-server-mean/143290
    lxyer1
        2
    lxyer1  
    OP
       285 天前
    @MoeWang 你一语点破,十分感谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1296 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.