I want to reload the page upon back navigating in IE11 but couldn't make it work. I use JSF, HTML5. First, I open the developer tool, choose Network tab and disable "Always refresh from server".
My first page:
<body>
<a href="http://google.com">another page</a>
</body>
When I open the page and click on "another page" link and navigate back to the first page. I check on the Network tabs, the status code is 304 which means the first page is read from cache.
On Microsoft reference https://msdn.microsoft.com/library/dn265017(v=vs.85).aspx, it says
In order to be cached, webpages must meet these conditions: Page has no beforeunload event handlers defined
So I define a beforeunload event handler inside the page. Now it becomes:
<body>
<a href="http://google.com">another page</a>
<SCRIPT>
window.onbeforeunload = function() {
console.log("HI");
}
</SCRIPT>
</body>
Now I do the exact steps as above, and during the process I get this log in Console tab:
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
That means back caching is disabled on this page, but I still get the 304 status code which means the page is not reloaded from server. (I check by turning off the server).
I also try to prevent caching by adding meta tags as below but it still doesn't help:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
Could you point out the problem for me?