Yes, Safari does not handle back / back button cache in the same way as Firefox and Chrome. In particular, an iframe, such as a vimeo or youtube video, is cached, although there is a new iframe.src.
I found three ways to handle this. Choose the best for your business. Solutions Tested on Firefox 53 and Safari 10.1
1. Determine if the user uses the back / forward button, then reload the entire page or reload only cached frames, replacing src
if (!!window.performance && window.performance.navigation.type === 2) { // value 2 means "The page was accessed by navigating into the history" console.log('Reloading'); //window.location.reload(); // reload whole page $('iframe').attr('src', function (i, val) { return val; }); // reload only iframes }
2. reload the whole page if the page is cached
window.onpageshow = function (event) { if (event.persisted) { window.location.reload(); } };
3. delete the page from the history so that users cannot visit the page again using the back / forward buttons
$(function () {
Javan R. Jun 08 '17 at 12:38 on 2017-06-08 12:38
source share