I have this to my javascript file:
window.addEventListener('pageshow', function(event) {
if (event.persisted) {
console.log('Page was loaded from cache.');
}
});
but if i navigate to another link and then hit back button, my html page is loaded from disk cache and the event.persisted is false. Any suggestions?
I think event.persisted indicates if a webpage is loading from "memory" cache. Not disk cache.