Skip to content

Commit 98b9941

Browse files
committed
Detect pages from bfcache
1 parent dceb91a commit 98b9941

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

js/obs.speedcurve.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,13 @@
4848
LUX.addData('fromCache', false);
4949
}
5050

51+
// Was the response from the back–forward cache?
52+
window.addEventListener('pageshow', (event) => {
53+
if (event.persisted) {
54+
LUX.addData('frombfCache', true);
55+
} else {
56+
LUX.addData('frombfCache', false);
57+
}
58+
});
59+
5160
})();

0 commit comments

Comments
 (0)