I recently discovered this new feature in Chrome: 我最近在Chrome中发现了这个新功能:
I can figure out the difference between option 1 and option 3, and that option 2 is probably something in between, but I can't find any more precise information anywhere. 我可以弄清楚选项1和选项3之间的区别,而选项2可能介于两者之间,但我无法在任何地方找到更精确的信息。
Anybody know the precise behavior of each of the 3 options? 有人知道3个选项中每个选项的确切行为吗?
#1楼
#2楼
Normal reload 正常重新加载
The same thing as pressing F5 . 与按F5相同。 This will use the cache but revalidate everything during page load, looking for "304 Not Modified" responses. 这将使用缓存,但在页面加载期间重新验证所有内容,查找“304 Not Modified”响应。 If the browser can avoid re-downloading cached JavaScript files, images, text files, etc. then it will. 如果浏览器可以避免重新下载缓存的JavaScript文件,图像,文本文件等,那么它就会。
Hard reload 硬重装
Don't use anything in the cache when making the request. 发出请求时,请勿在缓存中使用任何内容。 (which is equal to SHIFT + F5 No need to open Developer console) Force the browser do re-download every JavaScript file, image, text file, etc. (等于SHIFT + F5无需打开开发者控制台)强制浏览器重新下载每个JavaScript文件,图像,文本文件等。
Empty Cache and Hard Reload 空缓存和硬重新加载
Obviously, if the cache is empty then it will have to do a hard reload. 显然,如果缓存为空,则必须进行硬重载。 This will again force the browser to re-download everything. 这将再次迫使浏览器重新下载所有内容。 However, if the page makes any after-the-fact downloads via JavaScript that weren't part of page load, then these might still use the cache, which is where emptying the cache helps because it makes sure that even these won't use cached files. 但是,如果页面通过JavaScript进行任何不属于页面加载的事后下载,那么这些可能仍然使用缓存,这是清空缓存的帮助,因为它确保即使这些也不会使用缓存的文件。
Note : This feature is only available when the developer tools are open. 注意 :此功能仅在开发人员工具打开时可用。
#3楼
This also works in Mac OS X. Open developer tools, and then, on the reload button, either 1. secondary click (right click for right-handed mouse), or 2. long click, aka long press to see the menu. 这也适用于Mac OS X.打开开发人员工具,然后在重新加载按钮上,1。辅助点击(右键单击右手鼠标),或2.长按,即长按以查看菜单。
In addition to this answer , hard reload often causes proxies, content delivery networks and other remote caches to be refreshed. 除了这个答案 ,硬重载通常会导致代理,内容传送网络和其他远程缓存被刷新。
#4楼
The following method let you clear cache only for the troubled URL. 以下方法允许您仅清除故障URL的缓存。 It helped me when I was stuck with http to https redirection cache. 当我遇到http到https重定向缓存时,它帮助了我。
- Open Chrome developer tools, in Windows I use
F12打开Chrome开发者工具,在Windows中我使用F12 - Check
Preserve logto save the log before redirection 检查Preserve log以在重定向之前保存日志 - Right click the redirected URL and
Clear browser cache右键单击重定向的URL并Clear browser cache
This will clear only the troubled cache without affecting normal cache. 这将仅清除故障缓存而不影响正常缓存。