So it's the second time happening today. I enter the site and on the up-right other user's picture rep and badges appear. I clicked on it and it took me to his profile page, when on his page the up-right part with picture rep and badges turned to normal. It happened now and about 2 hours ago, and there were 2 different profiles. Why is this happening?
1 Answer
One possible explanation, as noted by Martijn Pieters in the comments, is a badly posed Cache-Control
header, which seems to be a side effect of using [OutputCache]
, even when we take pains to ensure that it doesn't cache for logged in users. I've had another stab at hacking our already hacked implementation, with the result that it should now continue to behave as normal for anonymous users, but logged in users will receive Cache-Control: private
for these pages.
I cannot say for sure whether this was the actual cause, but it is consistent with what we would expect if an intermediate proxy decided to cache.
As side notes, note that the public
header included no-cache="Set-Cookie"
, so this wouldn't have led to any cookie hijacking - and only applies to GET
requests.
If you inspect this page now you should see this in action. I will deploy to the other sites after a brief stability check.
-
-
As a historical note this used to (generally) be fine before because
Vary
was set to*
, but now that it's justAccept-Encoding
intermediate proxies were able to more liberally cache the response (though they sometimes incorrectly did withVary: *
too) Aug 6, 2014 at 12:22 -
@TimStone that's a red herring; that is because of the changes I made here; fixing that Aug 6, 2014 at 12:45
-
Ah, so the response was being incorrectly cached in this case too. Hopefully they follow
Cache-Control: private
better than they followed theVary: *
exception. Aug 6, 2014 at 12:49 -
@TimStone the "Vary" thing looks like a bug in IIS; we're wrestling with it Aug 6, 2014 at 16:00
https://stackoverflow.com
while at the office to prevent this.