zoukankan      html  css  js  c++  java
  • vue项目,代码部署之后,如何解决浏览器存在缓存问题

    1.在index.html头部添加如下代码:

    <meta http-equiv="pragram" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">

    2.在nginx.conf页面添加如下代码:

    location = /index.html {
        add_header Cache-Control "no-cache, no-store";
    }

     3.在开发中使用sessionStorage而不是localStorage存储信息,代码部署更新之后刷新页面或者重新打开一个页面就可以清缓存。

  • 相关阅读:
    if 语句
    变量命名
    python变量
    运算符
    注释
    PyCharm
    python版本,执行
    Tornado 【简述】
    Git 【管理篇】
    MySQL的介绍
  • 原文地址:https://www.cnblogs.com/jiaxiaonuo/p/12552607.html
Copyright © 2011-2022 走看看