Professional Documents
Culture Documents
RWD Bloat
RWD Bloat
RWD Bloat
BLOAT
Dave Rupert @davatron5000
K
C
A
T
T
A THE
F
O
E
T
I
S
B
E
paravelinc.com
retailmenot.com
shoptalkshow.com
IM KINDA
POST-RWD
Okay. What
problems are
you having?
images
images
uhh
uhh
web fonts
images
uhh
uhh
web fonts
web apps?
NOT REALLY
RWD SPECIFIC
WEBSITES 2014
2000
Transfer KB
1667
1333
Image KB
1000
12/2014 1/2015 2/2015 3/2015 4/2015 5/2015 6/2015 7/2015 8/2015 9/2015 10/2015 11/2015
A WEBSITE IN 2014
BLAME THE
IMPLEMENTATION,
NOT THE
TECHNIQUE.
Tim Kadlec
but surely
theres
footprint
So I examined the
best website ever
made
FACTS
TOTAL: 174kb
16%
3%
14%
24%
24%
18%
HTML
CSS
JS
Images
Fonts
Analytics & Ads
CSS: 24kb
Media Queries
2.4kb
10%
Vendor Prefixes
1.4kb
6%
JS: 41.2kb
jQuery
33.1kb
78%
Prism.js, Lettering,
etc
7kb
17.3%
FitVids, FitText
2kb
4.7%
Images: 31.92kb
Images: 31.92kb
Fonts: 42.6kb
Open Sans
31.7kb
54.1%
Symbolset
26.8kb
45.8%
TOTAL COST OF
RESPONSIVE
WEB DESIGN
4.4KB
LETS TAKE A
DEEPER LOOK
Home
Article
PageSpeed (Mobile)
79
78
PageSpeed (Desktop)
93
91
1.3s
1.5s
DOMContentLoaded
1.77s
1.83s
1446
1749
http://timkadlec.com/2014/01/fast-enough/
http://timkadlec.com/2014/01/fast-enough/
#PROTIP
PROBLEMS
No text until ~2.5 seconds
Webfonts blocking type rendering?
Sub-optimal image spriting (172 icon font)?
Time to first-byte is ~500ms, has no CSS in it
BASELINE
Home
Article
PageSpeed (Mobile)
79
78
PageSpeed (Desktop)
93
91
1446
1749
0. Normalize
CSS Reset
Normalize
CSS Selectors
679
578
1446
1376
1749
1412
1. Unblock fonts
Fonts in <head>
Fonts with
loadCSS()
1376
1327
1412
1284
2. No jQuery
2. No jQuery
3. SVG Sprites
<svg title="Home">
<use xlink:href="/images/spritemap.svg#icon-house"></use>
</svg>
http://css-tricks.com/svg-sprites-use-better-icon-fonts/
3. SVG Sprites
Icon Font
SVG Sprite
1327
1264
1284
1222
4. CSS Cleanup
Icon Font
SVG Sprite
1264
938
1222
1126
MAKE YOUR
WEBSITE FASTER
WITH THIS ONE
WEIRD TRICK.
5. CRITICAL CSS
Calculate style rules that appear above the fold
Print them in an inline <style> block in the <head>
Lazyload your stylesheet at the bottom of the page
<html>
<head>
<style>
.blue{color:blue;}
</style>
</head>
<body>
<div class="blue">
Hello, world!
</div>
<script>
function loadCSS( file ) {
// stuff
}
loadCSS('css/stylesheet.css');
</script>
</body>
</html>
5. CRITICAL CSS
Normal
Critical CSS
938
728
1126
1065
FINAL RESULTS
Home
Article
PageSpeed (Mobile)
79 98
78 96
PageSpeed (Desktop)
93 98
91 97
1446 728
1749 1065
Yeah, sure.
Maybe on a tiny
blog. What about
a real website?
47 HTTP Requests
3.6MB
Speed Index 1307
DESIGN
DIRECTION
3 Webfonts
38 images
1.456MB in animated GIFs
Chart.js
Scroll-triggered animations
and a Quiz with audio
Two-color PNGs
PERFORMANCE
ANXIETY
Enable GZIP
Optimize images
Minify and compress JS
Lazyload images
Setup Critical CSS
Async/Defer Scripts
More image optimization
50 HTTP Requests
2.4MB
Speed Index 651
TOOLS
LESSON:
THROTTLING IS SUPER IMPORTANT
SINCE MOST OF THE WORLD WONT
HAVE GOOGLE FIBER FOR A FEW MORE
YEARS. FUCK YEAH, AUSTIN TX.
PNGQuant
LESSON:
DESIGNERS, YOURE JOB IS NOT DONE
UNTIL THE SITE SHIPS.
LESSON:
PERFORMANCE IS EVERYONES JOB.
NOT JUST DEVELOPERS.
THANKS
Dave Rupert @davatron5000
ONE MORE
THING
OVERUNDER
Simple trivia for social people.
Follow @overunderapp
THANKS
Dave Rupert @davatron5000