vue版本更新index.html缓存


<head>
    <meta charset="utf-8">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Expires" content="0"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no">
    <link rel="icon" href="./favicon.ico" type="image/x-icon"/>
    <meta name="format-detection" content="telephone=yes"/>
    <title>xxx</title>
</head>

https://blog.csdn.net/u012375924/article/details/82806617 详情解说

在 index.html 页面前面加 meta 标签,注意:记得加上,我就是忘记加上了,一直测试不过。

1 <meta http-equiv="pragram" content="no-cache">
2 <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
3 <meta name="viewport" content="width=device-width,initial-scale=1.0"> 

但是把打包好的index.html放到服务器里去的时候,index.html在服务器端可能是有缓存的,这需要在服务器配置不让缓存index.html
nginx 配置如下:

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

https://www.cnblogs.com/daheiylx/p/12705090.html

https://blog.csdn.net/chen_bo526/article/details/103923070?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM