方法一:javascript
script标签中src连接,或者link标签的href连接,后面加上版本号:css
<script type='text/javascript' src='//site.com/js.js?v=1.0.0'><\/script> <link rel="stylesheet" href="index.css?time=20180910">
方法二:java
js生成时间戳:缓存
document.write('<link rel="stylesheet" href="index.css?time='+new Date().getTime()+'">');。
方法三:ui
css的meta标签设置不缓存spa
<meta HTTP-EQUIV="pragma" CONTENT="no-cache"> <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> <meta HTTP-EQUIV="expires" CONTENT="0"> <meta http-equiv="Cache" content="no-cache">