方法一:
script標簽中src鏈接,或者link標簽的href鏈接,后面加上版本號:
<script type='text/javascript' src='//site.com/js.js?v=1.0.0'><\/script> <link rel="stylesheet" href="index.css?time=20180910">
方法二:
js生成時間戳:
document.write('<link rel="stylesheet" href="index.css?time='+new Date().getTime()+'">');。
方法三:
css的meta標簽設置不緩存
<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">