禁止web页面浏览器缓存

通过 html 标签设置 cache-control

不推荐,不靠谱

  <meta http-equiv="Pragma" content="no-cache" />  
  <meta http-equiv="Expires" content="0" /> 
  <meta http-equiv="Cache-Control" content="no-cache" /> 

通过nginx设置

location / {
    root **;  
    # 配置页面不缓存html和htm结尾的文件
    if ($request_filename ~* .*.(?:htm|html)$) 
    {
        add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
    }
    index  index.html index.htm;
}
posted @   火炬冬天  阅读(25)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示