TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Shift+Cmd+R and Cmd+R always returning different results? (Chrome and Firefox)

1 点作者 jasalo将近 7 年前
This is the weirdest error I&#x27;ve had regarding cache. On browsers in which I&#x27;ve previously visited the website, there&#x27;s some sort of &quot;forced&quot; cache that, no matter how many times I do Cmd+R, it still loads a cached version of an index.html file.<p>Also, if I do Shift+Cmd+R it correctly loads the new version (on Firefox), but if I do Cmd+R again, it loads the old cached file again!<p>Weirdest thing is that in Chrome, Shift+Cmd+R ONLY works if the dev console is open. Any ideas as to what can be happening here?<p>I&#x27;m sending a `Cache-Control: no-cache` header which only shows up on the &quot;Shift+Cmd+R&quot; cases. Shouldn&#x27;t the file be re-cached once Shift+Cmd+R has &quot;correctly&quot; worked (i.e. loaded the new file)?

1 comment

sbjs将近 7 年前
I don&#x27;t understand cache fully, but I do know that if you open Dev Tools in Chrome and long-press the Refresh button, it will give you a drop down with the option &quot;Empty Cache and Hard Reload&quot;, and also shows you that Shift+Cmd+R is just Hard Reload without emptying the cache. Sometimes I need to do this, but I don&#x27;t fully know why or when.