• 请不要在回答技术问题时复制粘贴 AI 生成的内容
lxyer1
V2EX  ›  程序员

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

  •  
  •   lxyer1 · Jul 18, 2023 · 1871 views
    This topic created in 1042 days ago, the information mentioned may be changed or developed.

    我的网站设置了 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 replies    2023-07-18 16:43:22 +08:00
    MoeWang
        1
    MoeWang  
       Jul 18, 2023 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
       Jul 18, 2023
    @MoeWang 你一语点破,十分感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5408 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 06:52 · PVG 14:52 · LAX 23:52 · JFK 02:52
    ♥ Do have faith in what you're doing.