Safari browser ignoring my no-cache
Asked Answered
E

1

6

I'm unable to force a page to always expire in Safari. Chrome, IE and Firefox are good citizens but Safari is cruising along just fine with ignoring the following ASP.NET code:

// Expire immediately
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");

Any recommendations?

Ecesis answered 2/8, 2010 at 4:13 Comment(1)
I've found a hint to the problem here: projectseven.com/extensions/info/safaribbfix/index.htm. Apparently Safari doesn't treat the back button the same as other browsers.Ecesis
E
7

Believe it or not, the way to make Safari always reload the page was simply to add this to the body tag:

onunload=""

I found a mention of this here: Is there a cross-browser onload event when clicking the back button?

Ecesis answered 3/8, 2010 at 11:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.