Aggressive caching in IE 11

(Rikki Tooley) #1

The explanation

So this isn’t well documented at all, but new versions of Internet Explorer have a “feature” which transparently and aggressively caches everything. My experience of this comes from developing Windows Phone apps (via HttpClient), where repeated calls to a given API endpoint would return the same payload - it won’t even ask the server if it has changed, but instead just returns what was cached previously. I believe the caching is based on the URL, because a workaround to this is to attach a random query string onto the end of the URL.

An example implementation can be seen in my .NET library:

An alternative solution which I haven’t tested and don’t fully understand:

Previously I believed this only applied to Windows Phone. But I am seeing the same kind of behaviour in IE11 Desktop and Metro when using Discourse - a potential reason is Microsoft’s continuing march to One Codebase For Everything.

The problem

  1. Visit main page and observe topic counters and stuff
  2. Left click on a topic link (in order to clear a counter)
  3. Read a bit/ wait until you know the main page will have changed due to new activity
  4. Click the logo to go back to the main page
  5. Observe the page being the same as it was when you left.

A manual refresh is required to get the new state.

I could be doing something wrong, pinning the blame wrongly on IE when Discourse is at fault, but I don’t think so because I don’t see the same thing happening in Firefox.

Can anyone else reproduce this?

P.S. if anyone is wondering why I’m opening so many IE related issues lately it’s because I figured that since I’m fairly unique in being an active user of Windows and Windows Phone 8+ - most dev people don’t use IE habitually - I thought it’d be a good way to help out. After all, over 50% of real people still use IE.

Stale Data on Internet Explorer 11
(Jeff Atwood) #2

Yet again, no repro. Here’s what I did using IE11 and

  1. Visited main page at in IE11
  2. Left clicked on a new topic
  3. Read a bit
  4. In another browser window (Chrome) post a new topic as a new user.
  5. In IE11, click the logo to go back to the main page.
  6. The page shows the new topic created in the other web browser.

I really need a repro I can actually reproduce here.

(Rikki Tooley) #3

I closed all my IE windows and restarted my computer. I can’t reproduce it anymore…

I had had multiple windows open all day, perhaps something breaks internally over time? I’ll get a video next time I see it…

(Jeff Atwood) #4

I am able to repro as a regular user only. Cannot repro as admin. Closing since the other topic was first (linked in the gutter above the first post).

(Jeff Atwood) #5