如何用 HTML 以程式設計方式清除瀏覽器快取?
你可以使用以下元標籤告訴瀏覽器不要快取你的頁面 -
<metahttp-equiv = 'cache-control' content = 'no-cache'> <metahttp-equiv = 'expires' content = '0'> <metahttp-equiv = 'pragma' content = 'no-cache'>
此外,嘗試以下操作: 將一個引數/字串附加到指令碼標籤中的檔名。當檔案更改時更改它。
<scriptsrc = "newfile.js?version = 1.0.0"></script>
然後,下次更新檔案時,只需更新版本,即
<scriptsrc = "newfile.js?version = 1.0.1"></script>
廣告