0

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?

christk
  • 495
  • 5
  • 15

1 Answers1

0

I think event.persisted indicates if a webpage is loading from "memory" cache. Not disk cache.

lvanna9786
  • 21
  • 2