The persisted
read-only property indicates if a webpage is loading from a cache.
Syntax
window.addEventListener('pageshow', function(event) {
if (event.persisted) {
console.log('Page was loaded from cache.');
}
});
Value
A Boolean
.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'PageTransitionEvent: persisted' in that specification. |
Living Standard | Initial definition |
Browser compatibility
BCD tables only load in the browser