使用JS的Chrome Hard Reload

时间:2015-08-19 07:20:38

标签: javascript angularjs google-chrome

我们已经开发了一个基于AungularJS浏览器的应用程序并与客户端(一组来自客户端的人)进行测试,很难说服他们,如何"清空缓存和硬重新加载" (按F12,然后在右上角单击Refresh按钮并选择-Empty Cache and Hard Reload),

当时,我们只在Chrome浏览器上进行测试,有没有办法使用JS做,请按"硬重置按钮" (如document.location.reload(true);)

enter image description here

1 个答案:

答案 0 :(得分:0)

您无法在自己的页面外访问(很高兴),因此您无法在自己的页面窗口外单击以单击刷新按钮。

您可以做的最好的事情是设置html标签,让浏览器知道它不能使用缓存。

<head> </head>

之间添加以下内容
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="mon, 22 jul 2002 11:12:01 GMT">
<meta http-equiv="pragma" content="no-cache">