6. PERFORMANCE COMPONENTS
Server Side Rendering
Asset delivery
Client bandwidth
Client CPU cycles
26.01.201
9
Performance 6
7. SERVER SIDE RENDERING
Write fast code
Cache what can‘t be made fast
Consider stuff older than 5 sec static
Performance is design
OP-TI-MIZE
26.01.201
9
Performance 7
9. CLIENT BANDWIDTH
3G is broadband
One day of 2G per month
Ship less HTML
Ship less CSS
Ship WAY less JS
OP-TI-MIZE…. Pretty please
26.01.201
9
Performance 9
10. CLIENT CPU CYCLES
Test on slow devices
Kill on-scroll
Transition via CSS
Offload defered JS onto threads
Aim for 60 fps
26.01.201
9
Performance 10
14. TERMINOLOGY
FCP: First contentful paint
FMP: First meaningful paint
TTI: Time to interactive
PB: Performance Budget
Bloat: CSS/JS not used in current
document
26.01.201
9
Performance 14
16. 1 SET GOALS
First Meaningful Paint < 1 sec
Time to Interactive < 5 sec (on slow 3G)
Time to interactive < 2 sec (repeated
visits)
26.01.201
9
Performance 16
17. 2: CRITICAL CSS
Max Budget: 14kb
Include in <head>
Consider click through
Bloat Budget: 15%
Stay < 170kb textfile-size (compressed)
26.01.201
9
Performance 17
18. 3 LOAD LIGHTLY
Trim
Defer
Lazy-load
Use lightweight alternatives
Minimize 3rd party scripts
26.01.201
9
Performance 18
19. 4 LEGACY LOADING
Load core scripts normally
Use <script type=„module“> for modern
browsers
26.01.201
9
Performance 19
20. 5 CSS GROUPING
Load blocking JS before blocking CSS
Split up critical CSS per media query
Measure
Experiment
Repeat
26.01.201
9
Performance 20
22. 7 WEBFONTS
Seriously consider system fonts
Remove bloat subsets
Remove bloat charsets
Make use of font-display
26.01.201
9
Performance 22
23. 8 OPTIMIZE IMAGES
Use webP
Optimize image size per viewport
Bootstrap package can help here
3SL Image Rendering Service
26.01.201
9
Performance 23
24. 9 HEADERS
Set HTTP Cache headers properly
Set HTTP security headers properly
26.01.201
9
Performance 24
25. 10 COMPRESSION
Use Brotli
Use Zopfli
Use at least gzip
26.01.201
9
Performance 25
26. 11 HTTP/2
Serve via HTTP/2
Verify HPACK compression is available
Monitor mixed-content warnings
Enable OCSP stapling
^^ speeds up TLS handshakes
26.01.201
9
Performance 26
27. 12 SERVICE WORKER
Use service workers
… for webfonts
… for CSS
… for JS
… for re-used images
26.01.201
9
Performance 27