当前位置: 首页 > article >正文

nginx配置不缓存资源

方法1

        location / {
            index  index.html index.htm;
            add_header Cache-Control no-cache,no-store;
            try_files $uri $uri/ /index.html;
            #include mime.types;
            if ($request_filename ~* .*\.(htm|html)$) 
            {
              add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
            }
        }

方法2

        location / {
            index  index.html index.htm;
            add_header Cache-Control no-cache,no-store;
            try_files $uri $uri/ /index.html;
            #include mime.types;
            #if ($request_filename ~* .*\.(htm|html)$) 
            #{
            #  add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
           # }
        }
       location = /index.html {
            #add_header Cache-Control "no-cache, no-store, must-revalidate";
            add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
            add_header Pragma "no-cache";
            add_header Expires "0";
    }

http://www.kler.cn/a/402506.html

相关文章:

  • Spark SQL大数据分析快速上手-完全分布模式安装
  • LLM( Large Language Models)典型应用介绍 1 -ChatGPT Large language models
  • 3_Flink CDC
  • Eagle-OJ 开源的在线编程训练平台
  • Mybatis框架之适配器模式 (Adapter Pattern)
  • ReactPress:基于pnpm的Mono Repository方案介绍
  • Docker用法详解
  • Docker-Compose 快速部署安装 Nginx 或其他应用
  • uniapp页面样式和布局和nvue教程详解
  • 2020 年 9 月青少年软编等考 C 语言三级真题解析
  • Django实现智能问答助手-进一步完善
  • Go(java基础)
  • AI 赋能电商的未来:购物推荐、会员分类与智能定价的创新实践
  • 2. SpringBoot + MQTT 门禁设备对接实战
  • Kafka Stream实战教程
  • 深入解析小程序组件:view 和 scroll-view 的基本用法
  • 测试使用vite搭建的uni-app打包app区分开发环境和生产环境
  • linux 中mysql查看慢日志
  • 51c自动驾驶~合集31
  • 用Rust中byteorder包高效处理字节序列