- Use responsive images
- Inline critical CSS (if the CSS is <50k probably worth inlining everyhing)
- Use a web font loading strategy, eg. https://www.filamentgroup.com/lab/font-events.html
- Configure your server to handle gzip, etags... correctly https://github.com/h5bp/server-configs-apache
- Load JavaScript async
- Use a CDN (be sure to think about fallback scenarios)
- Use Service Worker
This file contains 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 characters
remove: function( key ) { | |
try { | |
localStorage.removeItem( storagePrefix + key ); | |
return this; | |
} catch( e ) { | |
return false; | |
} | |
}, | |
get: function( key ) { |
This file contains 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 characters
<div class="background"></div> |
This file contains 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 characters
# Test 1: | |
1) Cloned the repo | |
2) Started Server via | |
``` | |
npm install http-server -g | |
http-server -c-1 | |
''' | |
3) Opened page https://localhost:8080/ | |
4) Reloaded - got console message "This page is controlled by a ServiceWorker" |
This file contains 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 characters
Request URL:http://localhost/sw/2/simple-serviceworker-tutorial/script.js | |
Request Method:GET | |
Status Code:200 OK (from ServiceWorker) | |
Request Headers | |
Provisional headers are shown | |
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 | |
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36 | |
Response Headers | |
accept-ranges:bytes | |
content-encoding:gzip |
This file contains 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 characters
Remote Address:127.0.0.1:80 | |
Request URL:http://localhost/sw/2/simple-serviceworker-tutorial/script.js | |
Request Method:GET | |
Status Code:200 OK | |
Request Headersview source | |
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 | |
Accept-Encoding:gzip, deflate, sdch | |
Accept-Language:en,en-US;q=0.8,de-DE;q=0.6,de;q=0.4 | |
Cache-Control:no-cache | |
Connection:keep-alive |
This file contains 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 characters
<div class="background"></div> |
This file contains 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 characters
/** | |
* My name is ... 12s animation | |
*/ | |
/* | |
* currently only works in Firefox cause there is a bug in Webkit https://bugs.webkit.org/show_bug.cgi?id=23209 | |
*/ | |
p, | |
h1 span { |
This file contains 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 characters
/** | |
* slider menu (css only) | |
*/ | |
/** | |
* its not usable nowadys as it | |
* only works in Firefox and Webkit (should also work in IE10 but not tested) | |
* and even there you can not select the subnavi via keyboard | |
*/ |
This file contains 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 characters
/** | |
* Loading... | |
*/ | |
/** | |
* An attempt of an accessible and crossbrowser loading bar. | |
* Remove the animations from the pseudo elements to see how it looks like in old browsers, simple eh? | |
*/ | |
@keyframes load { |
OlderNewer