Last active
July 2, 2018 14:03
-
-
Save nuc/02a11d72fa96bc57df9cfe35e51934f1 to your computer and use it in GitHub Desktop.
Revisions
-
nuc revised this gist
Jul 2, 2018 . No changes.There are no files selected for viewing
-
nuc revised this gist
May 3, 2018 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,14 @@ function getTimeToInteractive() { return domInteractive - requestStart; } /* * returns: [ * { * name: 'haha.js', * duration: 12313, * transferSize: [bytes || 0 if served from cache] * }] */ function getResourceEntries() { return window.performance.getEntriesByType('resource') || []; } -
nuc revised this gist
May 3, 2018 . 2 changed files with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,6 @@ <!-- Browser support: partial Success rate: 30%-90% depending on browser Can prefetch HTML: yes --> <link rel="prefetch" href="index.html" /> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,11 @@ function getResourceEntries() { return window.performance.getEntriesByType('resource') || []; } /* * Browser support: full * Success rate: > 95% * Can prefetch HTML: no */ function prefetchResource(resourceURL) { const xhrRequest = new XMLHttpRequest(); xhrRequest.open('GET', resourceURL, true); -
nuc revised this gist
May 3, 2018 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,2 @@ <!-- can be used for html documents --> <link rel="prefetch" href="index.html" /> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,7 @@ function getResourceEntries() { return window.performance.getEntriesByType('resource') || []; } // can be used for JS & CSS Assets function prefetchResource(resourceURL) { const xhrRequest = new XMLHttpRequest(); xhrRequest.open('GET', resourceURL, true); -
nuc revised this gist
May 3, 2018 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,4 +7,10 @@ function getTimeToInteractive() { function getResourceEntries() { return window.performance.getEntriesByType('resource') || []; } function prefetchResource(resourceURL) { const xhrRequest = new XMLHttpRequest(); xhrRequest.open('GET', resourceURL, true); xhrRequest.send(); } -
nuc revised this gist
May 3, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <link rel="prefetch" href="index.html" /> -
nuc revised this gist
May 3, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,8 @@ function getTimeToInteractive() { const requestStart = window.performance.timing.requestStart; return domInteractive - requestStart; } function getResourceEntries() { return window.performance.getEntriesByType('resource') || []; } -
nuc created this gist
May 3, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ function getTimeToInteractive() { const domInteractive = window.performance.timing.domInteractive; const requestStart = window.performance.timing.requestStart; return domInteractive - requestStart; }