How to force Internet Explorer (IE) to REALLY reload the page?

155

43

When using Internet Explorer 8 to test my web application I often find it doesn't reload the page, so I don't see my changes. This has resulted in a lot of wasted time and frustration wondering why my fix "didn't work" - when in fact the browser never loaded the fixed version.

I've tried the Refresh button. I've tried F5, Control-F5, Control-R, Control-Shift-R, holding Control while clicking the Refresh button, everything I could think of - it doesn't actually load the new contents from the server. I've confirmed this with Fiddler.

How do I tell IE "I don't care what you think you have cached, I want to reload the page - no really, I mean it this time, honest-to-God, I want you to actually go to the server and download everything again"?

EMP

Posted 2009-12-09T23:52:52.113

Reputation: 4 688

2Best wording of a question I have encountered so far on StackExchange! – user785529 – 2016-06-07T12:49:57.647

Control+F5 goes past the Cache, it's odd if it doesn't.... – Tamara Wijsman – 2010-07-14T19:41:17.410

2Use a private browsing window, maybe? – Josh Lee – 2009-12-09T23:54:28.303

3Is it possible that your web server is serving the old page (via cache) instead of the new version? Doesn't matter how many times you reload in that case. – Michael Todd – 2009-12-09T23:56:46.300

1Michael, no, I verified in Fiddler that IE is not getting the page contents from the server. – EMP – 2009-12-10T00:06:23.183

Answers

126

  1. Select Tools >> Internet Options.
  2. Click the Settings button in Browsing History.
  3. Select the Every time I visit the webpage radio button.
  4. Click OK to close the Settings dialog.
  5. Click OK to close the Internet Options dialog.

Gonzalo

Posted 2009-12-09T23:52:52.113

Reputation: 1 396

6I agree with @EricLaw, if you use Fiddler you will see that files associated with the page are sometimes not reloaded even when "Every time I visit the webpage" is set. Use the IE toolbar menu: Cache > Always refresh from server, or the Clear Cache button in Fiddler. – Phillip Ngan – 2010-03-04T17:32:14.517

Thanks, this is what I ended up doing. I wonder if that hurts general browsing performance though. Also, if I ever need to get an end-user to do this it's not ideal (confusion, browser settings locked down, etc.). I'd love some simple way of doing a one-time reload, but I guess that doesn't exist in IE. – EMP – 2009-12-10T00:08:13.103

3If this is what you did, mark it as the answer – Earlz – 2009-12-10T00:15:30.397

36It may hurt general browsing performance, but only if you do your general browsing with IE... – Joel Mueller – 2009-12-10T01:07:11.150

3Ev: The user-facing side of this is usually fixed by changing the URLs for all scripts and stylesheets every time you touch the code, typically by adding a ?version-number query string suffix. – bobince – 2009-12-10T01:53:57.190

@PhillipNgan Unfortunately, "Always refresh from server" doesn't always work, either... – Izkata – 2013-10-14T20:24:30.497

4

"Every time I visit the webpage" likely doesn't do what you think it does. See http://www.fiddler2.com/redir/?id=httpperf

– EricLaw – 2010-01-05T20:33:41.050

43

Since it's stated that IE8 is the browser, you can press F12 to open the development tools and select the Cache menu at the top and then always refresh from server to bypass cache.

In short, Press F12. Click Cache -> Always Refresh from Server

You can simply clear your cache here as well, if that is the desired action. The always refresh option is not a global option and will not hinder overall performance in IE.

IE7 also has development tools, but they must be installed separately. You can also use the IE8 dev tools to run the browser in IE7 mode.

Brandon

Posted 2009-12-09T23:52:52.113

Reputation: 431

4In IE 11 this option is under F12 -> Network -> 3th icon from left. – Den – 2015-08-03T09:00:53.517

+1 for solving this without using a global option. – Marcus Riemer – 2012-12-12T13:48:09.080

Similar to here, that still doesn't always refresh all content. And I don't know that that reload is good across URLs either -- each window seems to have its own F12 at times. This is a more thorough way to do if, iff you have access to the javascript include.

– ruffin – 2013-02-04T15:15:54.403

1How do you do this in IE 11? There's no cache option I can find. – David Thielen – 2014-06-17T14:33:05.030

22

Ctrl+F5 in IE reloads the page ignoring the cache

mfeingold

Posted 2009-12-09T23:52:52.113

Reputation: 357

3ctrl+f5 does not always reload everything from the server. In my tests javascript contained in the html file do not reload after pressing ctrl-f5 even though the page has changed. – rcarver – 2011-12-02T13:15:31.177

As it does in Firefox as well. – Zhaph - Ben Duguid – 2009-12-10T00:41:58.057

The OP says that doesn't work for him. (Well, maybe he's wrong.) – Michael Ratanapintha – 2009-12-10T00:42:12.500

26No, it doesn't. I know it ignores the cache some of the time, but not all the time. – EMP – 2009-12-10T00:56:06.067

16Ctrl+f5 always reloads the page from the server. What it doesn't necessarily do is reload the extra files that page references – None – 2009-12-10T01:53:46.440

2Fair enough - but I need it to reload EVERYTHING. – EMP – 2009-12-10T05:55:20.793

1CTRL+F5 should perform a full refresh of the page and all of its resources. Calls made via XMLHTTPRequest later might be cached (if you don't want them cached, send appropriate no-cache headers).

The one caveat is that if the page in question is XML, it's really being loaded via MSXML, and that DocHost does NOT respect CTRL+Refresh properly. – EricLaw – 2010-01-05T20:32:52.970

19

IE is very eager to cache pages, even when you tell it not to via cache headers. Microsoft KB 234067 explains the requisite incantations. In short, you need to deliver the following headers.

Pragma: no-cache
Cache-Control: no-cache
Expires: <some time in the past>

Setting Expires = -1 (as recommended in the KB article) should work for most frameworks; browsers are required to treat invalid date formats as being in the past (RFC 2616).

In .NET, you can do it on a page-by-page granularity by using this set of methods prior to calling the web page:

HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Response.Cache.SetValidUntilExpires(false);
HttpContext.Response.Cache.SetRevalidation(System.Web.HttpCacheRevalidation.AllCaches);
HttpContext.Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
HttpContext.Response.Cache.SetNoStore();

see: http://www.localwisdom.com/blog/2012/10/force-a-page-refresh-on-a-asp-net-mvc-website/ Works well for MVC3.0.

Marcelo Cantos

Posted 2009-12-09T23:52:52.113

Reputation: 1 321

That's all very well, but doesn't help WRT the question. – Matthias Urlichs – 2015-06-08T08:49:13.013

1

Untrue. IE6+ fully respects all cache-prohibiting headers. http://www.fiddler2.com/redir/?id=httpperf

– EricLaw – 2010-01-05T20:31:31.273

6

The Network tab of the web developer toolbar has a button to easily clear the cache. I usually use that in the case you describe.

It isn't ideal, since you may not really want to clear your entire cache, but since I don't use IE for general browsing, it works for me.

pkaeding

Posted 2009-12-09T23:52:52.113

Reputation: 1 420

4

This still happens in IE9. Amazingly, the answer is Ctrl-Shift-Refresh button

PandaWood

Posted 2009-12-09T23:52:52.113

Reputation: 141

Does that function differently than Ctrl-Refresh button? – Jon Onstott – 2013-04-10T22:14:56.733

3

Incidentally, the problem will possibly exist for your website viewers as well. I saw the following idea in an AJAX book...

Use PHP to add a random token to the current URL so that the browser is tricked into thinking it's a separate page.

Moshe

Posted 2009-12-09T23:52:52.113

Reputation: 5 474

Makes URLs ugly, though. – LawrenceC – 2012-08-22T18:38:55.183

2

Hold down either the alt or ctrl key as you click refresh button.

niaccm

Posted 2009-12-09T23:52:52.113

Reputation: 21

2

I've had the same problem myself. I believe the only way to do it is to clear the cache (Safety -> Delete Browsing History). Only check "Temporary Internet Files".

Hope this helps.

jchapa

Posted 2009-12-09T23:52:52.113

Reputation: 241

1

I agree that adding a random token to the url is the most reliable solution and once it's implemented the user doesn't have to do anything.

Aside from the random token approach what I tend to always do to force a complete reload (request) of the page and all of its dependant files I just place my cursor at the end of the url and press Enter. Works every time... and I use IE 8.

Jerry

Posted 2009-12-09T23:52:52.113

Reputation: 11

1

F12 -> CTRL+R is slightly faster for IE9+. As people have mentioned, IE doesn't clear the cache very intelligently like Chrome does.

Chris S

Posted 2009-12-09T23:52:52.113

Reputation: 853

1

I know this may seem a bit odd... but one thing I've noticed lately, is that you do sometimes get different results depending on HOW you "refresh". I've seen the following behaviour:

F5 > loads from cache without refresh,
Alt+D, ENTER > really refreshes bypassing the cache.
(Alt+D can be replaced with clicking in the address bar)

eidylon

Posted 2009-12-09T23:52:52.113

Reputation: 1 667