如何解决h5、vue、uniapp等项目缓存问题

您好,很抱歉打扰到您,我看您这边发了一篇如何解决h5、vue、uniapp等项目缓存问题的博客,我是用uniapp做的,打包成了h5,一直有缓存,我看您这边有解决办法,但是那个 let filePath = '',我不知道 filePath这个值要怎么写还是就这么空着

一般这种缓存问题 都是 动态的给 引入的 js,css路径加上 hash值 。vue 可以用webpack 配置

在项目的入口index.html(一般在public目录下)里面的head标签加下面代码:

    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta http-equiv="pragram" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="expires" content="0">

也可以百度http-equiv的参数含义就明白原因了