FabrizioCaldarelli
4/8/2015 - 1:06 PM

Prevent Safari loading from cache when back button is clicked

Prevent Safari loading from cache when back button is clicked

// Javascript
window.onpageshow = function(event) {
    if (event.persisted) {
        window.location.reload() 
    }
};

// JQuery
$(window).bind("pageshow", function(event) {
    if (event.originalEvent.persisted) {
        window.location.reload() 
    }
});