Safari and Safari ios mobile uses the bfcache when a user clicks the 'back button' to return to the previous html page. No other browsers mobile or desktop have this behavior from what I can find. I have googled and have found many people complaining of the same thing but without any solution with Safari ios. I did find this fix for Safari Desktop (tested on windows) but it does not work for Safari ios.
window.onbeforeunload = function()
{
// This function does nothing. It won't spawn a confirmation dialog
// But it will ensure that the page is not cached by the browser.
};
window.onunload = function()
{
// Needed in OP in order to avoid caching. May also be needed in Safari.
};
Does anybody know how to do it for Safari ios?
The reason I want to do this is that I have a spinner indicator as well as a modal in certain cases displayed before I move on to the next web page. If the user clicks the back button Safari ios uses the cache and the spinner and/or modal are still there.
Any ideas?