We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dca6f20 commit 68415d7Copy full SHA for 68415d7
1 file changed
js/obs.speedcurve.js
@@ -34,4 +34,18 @@
34
window.LUX.addData(key, obs[key]);
35
}
36
37
+
38
+ // Was the response from HTTP cache or the network?
39
+ const navigation = performance.getEntriesByType('navigation')[0];
40
41
+ if (!navigation) return;
42
43
+ const { encodedBodySize } = navigation;
44
45
+ if (encodedBodySize === 0) {
46
+ LUX.addData('fromCache', true);
47
+ } else if (encodedBodySize > 0) {
48
+ LUX.addData('fromCache', false);
49
+ }
50
51
})();
0 commit comments