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