Safari browser ignoring my no-cache

2019-01-24 15:19发布

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?

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-01-24 16:03

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?

查看更多
登录 后发表回答