-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
347 lines (338 loc) · 10.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>reveal.js</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/custom.css">
<link rel="stylesheet" href="css/theme/performance.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Front-End Performance</h1>
</section>
<section>
<h2>Why speed matters</h2>
<img alt="Speed vs. Conversion" src="images/speed-vs-convserion.jpg" />
</section>
<section>
<h2>Why speed matters</h2>
<img alt="Time to interactive" src="images/time-to-interactive.png" />
</section>
<section class="measure-performance">
<h2>Measure Performance</h2>
<div class="measure-performance__grid">
<img alt="Webpagetest" class="measure-performance__image" src="images/webpagetest.svg" />
<img alt="Pagespeed Insights" class="measure-performance__image" src="images/pagespeed-insights.png" />
<img alt="Lighthouse" class="measure-performance__image" src="images/pwa-lighthouse.png" />
<img alt="Devtools" class="measure-performance__image" src="images/devtools.png" />
</div>
</section>
<section>
<h2>Low-hanging fruits with PSI</h2>
<img alt="Bol.com Pagespeed Insights" src="images/bol-com-pagespeed.png"/>
</section>
<section>
<h2>See more with Lighthouse</h2>
<img alt="Medimarkt Lighthouse" src="images/lighthouse-mediamarkt.png"/>
</section>
<section>
<h2>Webpagetest</h2>
<img alt="VTWonen webpagetest" src="images/webpagetest-vtwonen.png"/>
</section>
<section>
<h2>Remove all the things</h2>
<img alt="Bol.com Pagespeed Insights" src="images/allthethings.jpg"/>
</section>
<section>
<h2>Remove not needed:</h2>
<ul>
<li>Javascript</li>
<li>CSS</li>
<li>Images</li>
<li>Fonts</li>
</ul>
</section>
<section>
<h2>Coverage in Devtools</h2>
<img alt="Coverage in Devtools" src="images/coverage-ao-com.png"/>
</section>
<section>
<h2>Small, Smaller, Smallest</h2>
<p>Uncompressed jQuery = 270KB</p>
<div class="fragment">
<h3>Minified</h3>
<p>90KB</p>
</div>
<div class="fragment">
<h3>GZIP</h3>
<p>30KB</p>
</div>
<div class="fragment">
<h3>Brotli</h3>
<p>25KB</p>
</div>
</section>
<section>
<h2>Brotli Support</h2>
<img alt="Brotli, caniuse.com" src="images/brotli.png"/>
</section>
<section>
<h2>Brotli .htaccess</h2>
<pre><code># Specify Brotli-encoded assets
<Files *.html.br>
AddType "text/html" .br
AddEncoding br .br
</Files>
# Specify gzip-encoded assets
<Files *.html.gz>
AddType "text/html" .gz
AddEncoding gz .gz
</Files></code></pre>
</section>
<section class="javascript-execution">
<h2>Javascript download & execution</h2>
<div class="javascript-execution__grid">
<div>
<img alt="Javascript legend" src="images/js-legend.svg">
</div>
<div>
<div>
<h3>< script /></h3>
<img alt="Javascript script" src="images/js-script.svg">
</div>
<div class="fragment">
<h3>< script async /></h3>
<img alt="Javascript async" src="images/js-async.svg">
</div>
<div class="fragment">
<h3>< script defer /></h3>
<img alt="Javascript defer" src="images/js-defer.svg">
</div>
</div>
</div>
</section>
<section>
<h2>Javascript execution</h2>
<img alt="Javascriot parse" src="images/javascript-parse.png"/>
<p>Source: https://medium.com/dev-channel/the-cost-of-javascript-84009f51e99e</p>
</section>
<section>
<h2>Images</h2>
<img alt="Average Page Size in 2017, Source speedcurve.com" src="images/avg-page-size-2017.png"/><p>Source: speedcurve.com</p>
</section>
<section>
<h2>Optimize images</h2>
<ul>
<li>Image compression</li>
<li>WebP</li>
<li><Picture></li>
<li>Lazy loading</li>
<li>SVG</li>
<li>CDN</li>
</ul>
</section>
<section id="fragments" class="image-compression">
<h2>Image compression</h2>
<div class="image-compression__grid">
<div>
<img alt="Yellow Car, 100% quality" src="images/car-100.jpg" style="flex: 0 0 30%" />
1024 x 683px<br/>100% JPEG<br/>862KB
</div>
<div class="fragment">
<img alt="Yellow Car, 50% quality" src="images/car-50.jpg" style="flex: 0 0 30%" />
1024 x 683px<br/>50% JPEG<br/>122KB
</div>
<div class="fragment">
<img alt="Yellow Car, 50% quality + 70% WebP" src="images/car-50.webp" style="flex: 0 0 30%" />
1024 x 683px<br/>WebP<br/>60KB
</div>
</div>
</section>
<section>
<h2><picture> + webP</h2>
<pre><code class="html"><picture>
<source srcset="awesomeImage.webp" type="image/webp">
<img src="oldImage.jpg" alt="Power of webP">
</picture></code></pre>
</section>
<section>
<h2>WebP .htaccess</h2>
<pre><code><IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(media.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
AddType image/webp .webp</code></pre>
</section>
<section>
<h2>CDN (Cloudinary)</h2>
<img alt="CDN VTWonen" src="images/cloudinary-vtwonen.png"/>
</section>
<section>
<h2>CDN (Cloudinary)</h2>
<img alt="CDN VTWonen" src="images/image-compression-vtwonen.png"/>
</section>
<section>
<h2><picture></h2>
<pre><code class="html"><picture>
<source srcset="extralarge.jpg" media="(min-width: 1000px)">
<source srcset="large.jpg" media="(min-width: 800px)">
<img srcset="medium.jpg" alt="…">
</picture></code></pre>
</section>
<section>
<h2>Lazy loading</h2>
<img alt="Lazy loading" src="images/lazyload.gif"/>
</section>
<section class="svg">
<h2>SVG</h2>
<div class="svg__grid">
<div>
<img alt="Fire PNG" height="256" src="images/CampFireStories.png" width="256" />
<p>PNG - 19KB</p>
</div>
<div>
<img alt="Fire SVG" height="256" src="images/fire.svg" width="256" />
<p>SVG - 5KB</p>
</div>
</div>
</section>
<section>
<h2>SVGOMG</h2>
<img alt="SVGOMG" src="images/svgomg.png" />
</section>
<section class="svg">
<h2>SVG</h2>
<div class="svg__grid svg__grid--second">
<div>
<img alt="Fire PNG" height="256" src="images/CampFireStories.png" width="256" />
<p>PNG - 19KB</p>
</div>
<div>
<img alt="Fire SVG" height="256" src="images/fire.svg" width="256" />
<p>SVG - 5KB</p>
</div>
<div>
<img alt="Fire SVGO" height="256" src="images/fire-svgo.svg" width="256" />
<p>SVG - 1.8KB</p>
</div>
</div>
</section>
<section>
<h2>SVG vs. PNG</h2>
<img alt="SVG vs. PNG" src="images/svg-vs-png.png" />
</section>
<section class="no-fonts">
<h2>Fonts</h2>
No @font-face
<pre><code class="css">body {
font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”,
Roboto, Helvetica, Arial, sans-serif;
}</code></pre>
<div class="no-fonts__grid">
<div><img alt="Apple - San Francisco" src="images/sf.jpg"></div>
<div><img alt="Google - Roboto" src="images/roboto.jpg"></div>
<div><img alt="Microsoft - Segoe" src="images/segoe.jpg"></div>
</div>
</section>
<section>
<h2>Minimize amount of fonts</h2>
<div style="display: flex; justify-content: space-around;">
<div>
<img alt="Font with italic" src="images/font-with-embed-italic.png"/>
<p>Font with Italic</p>
</div>
<div>
<img alt="Font without italic" src="images/font-without-embed-italic.png"/>
<p>Font without Italic</p>
</div>
</div>
</section>
<section>
<h2>Do not use font icons</h2>
<img alt="Font Awesome Size" src="images/font-awesome.png" />
</section>
<section class="no-font-icons">
<h2>Do not use font icons</h2>
<div class="no-font-icons__grid">
<div>
<img alt="Font Awesome Site" src="images/font-awesome-site.png" />
<p>~3s</p>
</div>
<div>
<img alt="Font Awesome Loaded" src="images/font-awesome-loaded.png" />
<p>~9s</p>
</div>
</section>
<section>
<h2>font-display</h2>
<pre><code class="css">body {
font-display: swap; // block, fallback, optional
}</code></pre>
<img alt="" src="images/font-display.png">
</section>
<section>
<h2>Preload</h2>
<pre><code class="html"><link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin /></code></pre>
<img alt="" src="images/preload-financial-times.jpg">
</section>
<section>
<h2>Cache</h2>
<p>Expires Header en Cache-Control</p>
<pre><code><IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
<FilesMatch \.(html|xhtml|xml|shtml)$>
ExpiresDefault A600
</FilesMatch>
</IfModule></code></pre>
</section>
<section>
<h2>Service workers</h2>
<img alt="" src="images/service-worker.svg">
</section>
<section>
<h2>HTTP2</h2>
<img alt="HTTP2" src="images/http2.gif" />
</section>
<section>
<h2>Okay. Bye.</h2>
<iframe src="https://kozie.github.io/thomasboard/" height="50%" width="75%"></iframe>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>