Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari browser ignoring my no-cache

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?

like image 951
Keith Adler Avatar asked Aug 02 '10 04:08

Keith Adler


1 Answers

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?

like image 151
Keith Adler Avatar answered Sep 19 '22 05:09

Keith Adler