Web 开发 - 有没有办法强制刷新页面?

Web Development - Is there a way to force a page refresh?

在开发网站时,您将对页面进行大量更改。如果您的浏览器决定缓存页面并使用旧页面,这可能会产生问题。很多时候你想要最新的。

您可以通过转到设置->内容->清除浏览数据并在列表中选择 "Cache" 等来删除整个缓存。

问题是这会花费很长时间,尤其是当您只需要更改一页时。更重要的是,你真的不想清除所有的缓存,只是一个页面。有没有简单快捷的方法只清除问题页面的缓存?

是的,有!

Kinsta:

Before you go straight to clearing your entire browser cache, one trick you can try is something called a “force refresh”.

及以后:

  • Windows and Linux browsers: CTRL + F5
  • Apple Safari: SHIFT + Reload toolbar button
  • Chrome and Firefox for Mac: CMD + SHIFT + R

Again, this method only bypasses the cache for the specific page that you’re on. It leaves the rest of your browser cache untouched.