Stale Data on Internet Explorer 11


(Pugwash) #1

When clicking on the site logo to return to the main topic list on IE 11 the page is frequently populated with stale data. Forcing a refresh fixes the problem.

Some simple steps to reproduce…

  1. Create a new topic and return to the main topic list (i.e. the application root).
  2. Go back into the topic and modify the category.
  3. When returning to the main list the post reverts back to the original category
  4. Also going back into the post again will revert the category there too.

This was reported on our own meta area today, just fired up IE 11 and and can confirm this behaviour. It seems IE 11 likes to pull everything from the cache or is ignoring your headers?

Here’s my user-agent:

Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko

And some pics… probably not necessary:


(Jeff Atwood) #2

I suspect this might be related to some other new problems I’ve seen with IE11. The “Dismiss Unread” button, for example, appears to not work at all, but if you hard refresh, it actually did work. That feels like a cache problem to me.


(Pugwash) #3

Perhaps related?


(Jeff Atwood) #4

I can’t actually repro this on try.discourse.org though with your steps.

What’s missing from those steps is something important: how are you going “back”?

  • the back button on the browser? (that’s what I used, and it worked)
  • clicking the logo on the site?

(Pugwash) #5

Clicking the logo on the site. I reproduced this on try.discourse about 30 mins ago.

EDIT:

Only other thing to mention is I did have AdBlock + on there but then disabled it. Otherwise a fresh install of IE 11.


(Jeff Atwood) #6

I simply cannot reproduce this with your steps. Let me describe exactly what I am doing on http://try.discourse.org using IE11, step by step in as much detail as I can:

  1. Create a new topic by clicking the “Create Topic” button in the upper right.
  2. Enter a topic title and body. No category.
  3. Click “Create Topic”, I am now in my new topic
  4. Return to main topic list by clicking the logo or the back button (does not seem to matter)
  5. Click on the new topic title I just created to re-enter it
  6. Click the edit pencil next to the title of the topic
  7. Change the category from no category, to any category. Save the edit.
  8. Return to main topic list by clicking the logo or the back button (does not seem to matter)

I then see that my new topic has the edited category.


(Rikki Tooley) #7

Haha, I literally just wrote this up here (I must have started writing before this topic was posted):

Someone please merge as they see fit :smile:


(Pugwash) #8

Those steps are correct apart from step 2 where I did assign a category to the original post. Otherwise spot on, I also get the same stale data when using the back button.

I’ll try and get a screencast made and post it here.


(Jeff Atwood) #9

I also tried with a category, and no repro there either. Let me try as a new user in case it has to do with being an admin?


(Jeff Atwood) #10

As a new user in IE11:

  1. Create a new topic by clicking the “Create Topic” button in the upper right.
  2. Enter a topic title and body. Category is tech.
  3. Click “Create Topic”, I am now in my new topic
  4. Return to main topic list by clicking the logo.
  5. Click on the new topic title I just created to re-enter it
  6. Click the edit pencil at the bottom of the post.
  7. Change the category from tech, to pets. Save the edit.
  8. Return to main topic list by clicking the logo.

aha yes, now I can see it – the topic still says “tech”.

So there’s something about being an admin user that breaks the caching – I have to be a regular user to see this happen.


(Rikki Tooley) #11

I just noticed it’s happening in topics too. It does seem like the same behaviour that I had on Windows Phone (see the OP of the closed topic).

Anyway I’m off to watch Utopia, happy debugging everyone


(Pugwash) #12

Ok here’s a screencast, apologies about the speed :smile:

https://dl.dropboxusercontent.com/u/13606144/discourse/Discourse_on_ie_11.mp4


(Jeff Atwood) #13

Thanks – I can repro now, I just can’t repro as staff, I have to be in as a regular user.


(Sam Saffron) #15

Looks like we were making json GET requests and not specifying cache: false, which means it defaults to browser caching which is kind of arbitrary.

This commit should fix it:

https://github.com/discourse/discourse/commit/ce942fe324016f1399cd2499a41f2ffa4ae80a85

Confirmed my fix on try which is deployed.


(Sam Saffron) #16