no-cache-html:脚本向 url 添加随机查询,强制浏览器不缓存 HTML

时间:2021-06-07 13:57:42
【文件属性】:
文件名称:no-cache-html:脚本向 url 添加随机查询,强制浏览器不缓存 HTML
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-07 13:57:42
JavaScript UA(例如浏览器,webview)有时会缓存HTML,如果我们在url中添加一个随机查询参数,UA会强制获取最新HTML。 使用超过缓存时间时重新加载页面的机制 介绍 < head > <!-- the script must be the first script to load cache-time: how long to force UA to no cache(in ms), default: 600*1000(10 mins) flag-name: what is the name of random query param, do not conflict the regex, default: flag --> < script src =" bower_components/no-cache-html/index.js "
【文件预览】:
no-cache-html-master
----index.js(973B)
----readme.md(951B)
----test()
--------test2.html(169B)
--------test1.html(134B)
----.gitignore(6B)
----bower.json(251B)

网友评论