在Chrome的桌面,我有选项在开发工具完全禁用缓存时,开发工具被打开,我有选项手动做一个硬加载时,长时间点击重新加载按钮(与开发工具打开)。

Chrome for Android有这样的技术吗?我没有找到任何背景。 当我想强迫浏览器下载一些javascript或css文件,而不是使用一个缓存时,我该怎么做?


当前回答

这是另一个简单的解决方案,当其他人失败时,它可能奏效:

今天,当缓存问题是缓存的CSS文件时,一个相当简单的开发人员端解决方案对我来说是有效的。简而言之:创建一个临时html文件副本,并浏览到它来更新CSS缓存。

这个技巧可以刷新CSS文件,至少在Android的蓝色全球图标默认浏览器中(但很可能是它的孪生兄弟,官方Chrome浏览器,以及我们在“智能”手机上遇到的具有积极缓存趋势的其他浏览器)。

细节:

At first I tried some of the fairly simple solutions shared here, but without success (for example clearing the recent history of the specific site, but not months and months of it). My latest CSS would however not be applied apon refresh. And that even though I had already employed the version-number-trick in the CSS file-call in the head section of the html which had helped me avoid these pesky aggressive cachings in the past. (example: link rel="stylesheet" href="style.css?v=001" where you upgrade this pseudo-version number every time you make a change to a CSS file, e.g. 001, 002, 003, 004... (should be done in every html file of the site))

这一次(2019年8月)CSS文件版本号更新不再足够,这里提到的一些更简单的措施对我也不起作用,或者我甚至无法访问其中的一些(在借来的安卓手机上)。

最后,我尝试了一些相对简单的方法,最终解决了这个问题:

我复制了站点的index.html文件,给它一个不同的名字(indexcopy.html),上传它,在Android设备上浏览它,然后浏览回原始页面,刷新它(用地址栏左边的刷新按钮),voilà:这一次,index.html的刷新终于起作用了。

Explanation: The latest CSS file version was now finally applied on Android when refreshing the html page in question because the cached copy of the CSS file had now been updated when the CSS file was called from a differently named temporary html page that did not exist anywhere in the browser history and that I could delete again afterwards. The aggressive caching apparently ignored the CSS URL and went instead by the HTML URL, even though it was the CSS file that needed to be updated in the cache.

其他回答

启动Chrome Android应用程序 点击菜单查看更多选项。 从选项列表中选择“设置”。 向下滚动并点击“站点设置”选项卡。 在“站点设置”中打开“数据存储”选项卡。 点击要删除存储的站点URL。 点击“清除&重置”命令按钮。 刷新网站页面。

远程调试允许您使用桌面dev-tools:

https://developers.google.com/chrome-developer-tools/docs/remote-debugging

还有一个选项:

菜单 设置 隐私 清除浏览数据 选择“缓存”并按“清除”

然后重新加载页面。

有几个方法来强制重载铬移动设备:

清晰的历史(见上文) 使用远程调试(参见上面) 请求桌面站点 禁用“精简模式” 打开。js或。css的URL,然后正常重载。

这是另一个简单的解决方案,当其他人失败时,它可能奏效:

今天,当缓存问题是缓存的CSS文件时,一个相当简单的开发人员端解决方案对我来说是有效的。简而言之:创建一个临时html文件副本,并浏览到它来更新CSS缓存。

这个技巧可以刷新CSS文件,至少在Android的蓝色全球图标默认浏览器中(但很可能是它的孪生兄弟,官方Chrome浏览器,以及我们在“智能”手机上遇到的具有积极缓存趋势的其他浏览器)。

细节:

At first I tried some of the fairly simple solutions shared here, but without success (for example clearing the recent history of the specific site, but not months and months of it). My latest CSS would however not be applied apon refresh. And that even though I had already employed the version-number-trick in the CSS file-call in the head section of the html which had helped me avoid these pesky aggressive cachings in the past. (example: link rel="stylesheet" href="style.css?v=001" where you upgrade this pseudo-version number every time you make a change to a CSS file, e.g. 001, 002, 003, 004... (should be done in every html file of the site))

这一次(2019年8月)CSS文件版本号更新不再足够,这里提到的一些更简单的措施对我也不起作用,或者我甚至无法访问其中的一些(在借来的安卓手机上)。

最后,我尝试了一些相对简单的方法,最终解决了这个问题:

我复制了站点的index.html文件,给它一个不同的名字(indexcopy.html),上传它,在Android设备上浏览它,然后浏览回原始页面,刷新它(用地址栏左边的刷新按钮),voilà:这一次,index.html的刷新终于起作用了。

Explanation: The latest CSS file version was now finally applied on Android when refreshing the html page in question because the cached copy of the CSS file had now been updated when the CSS file was called from a differently named temporary html page that did not exist anywhere in the browser history and that I could delete again afterwards. The aggressive caching apparently ignored the CSS URL and went instead by the HTML URL, even though it was the CSS file that needed to be updated in the cache.