I got a browser page caching issue specifically with IE 11, the SomePage page is always loaded from browser cache. The same page work's perfectly in Edge, Chrome and FF.
The page is called from a JS function as below:
$.ajaxJsonAntiForgery({
type: "POST",
url: '@Html.Raw(Url.Action("SomeAPI", "cntrl"))',
dataType: "json",
data: { model: model },
success: function (result) {
if (result.Success) {
window.location = '@Html.Raw(Url.Action("SomePage", "cntrl"))';
...
I have tried following approached:
Appending some random number with the URL. - Didn't work
Added following code in action method : - Didn't work
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore(); Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); Response.Cache.SetMaxAge(TimeSpan.Zero); Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
and in Fiddler I can see following headers:
Adding OutputCache attributes on SomePage action method. - Didn't work
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*", Location = System.Web.UI.OutputCacheLocation.None)]
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
Please advice, what else should be in this page header, which will instruct the browser - that it should not cache this page?


