Performance Checklist 1.3
Performance Checklist 1.3
Below you’ll find an overview of the front-end performance issues you might
need to consider to ensure that your response times are fast and smooth.
____
Get Ready: Planning and Metrics
☐ Pick your battles wisely: React, Vue, Angular, Ember and Co.
Make sure that the framework of your choice provides server-side rendering. Be sure to
measure boot times in server- and client-rendered modes on mobile devices before settling on
a framework. Understand the nuts and bolts of the framework you’ll be relying on. Look into
the PRPL pattern and application shell architecture.
Delivery Optimizations
☐ Stream responses.
Streams provide an interface for reading or writing asynchronous chunks of data, only a
subset of which might be available in memory at any given time. Instead of serving an empty
UI shell and letting JavaScript populate it, let the service worker construct a stream where the
shell comes from a cache, but the body comes from the network. HTML rendered during the
initial nav request can then take full advantage of the browser's streaming HTML parser.
Quick wins
This list is quite comprehensive, and completing all of the optimizations might take quite a while.
So if you had just 1 hour to get significant improvements, what would you do? Let’s boil it all
down to 12 low-hanging fruits. Obviously, before you start and once you finish, measure results,
including start rendering time and Time To Interactive on slow 3G, slow 4G, cable connections.
1. Measure the real world experience and set appropriate goals. A good goal to aim for is Largest
Contentful Paint < 1 s, a Speed Index < 3s, Time to Interactive < 5s on slow 3G, for repeat visits,
TTI < 2s. Optimize for start rendering time and time-to-interactive.
2. Prepare critical CSS for your main templates, and include it in the <head> of the page. (Your
budget is 14 KB). For CSS/JS, operate within a critical file size budget of max. 170KB
gzipped (0.7MB decompressed).
3. Trim, optimize, defer and lazy-load as many scripts as possible, check lightweight alternatives
and limit the impact of third-party scripts.
4. Serve legacy code only to legacy browsers with the module/nomodule pattern.
5. Experiment with regrouping your CSS rules and test in-body CSS.
6. Add resource hints to speed up delivery with dns-lookup, preconnect, prefetch, preload, prerender.
7. Subset web fonts and load them asynchronously, and utilize font-display in CSS for fast first
rendering.
8. Optimize images with mozjpeg, guetzli, pingo and SVGOMG, and consider serving WebP with an
image CDN.
9. Check that HTTP cache headers and security headers are set properly.
10. Enable Brotli compression on the server. (If that’s not possible, don’t forget to enable Gzip
compression.)
11. Enable TCP BBR congestion if your server is running on the Linux kernel version 4.9+.
12. Enable OCSP stapling and IPv6 if possible.
13. If HTTP/2 is available, enable HPACK compression and HTTP/3 if it's available on CDNs.
14. Cache assets such as fonts, styles, JavaScript and images in a service worker cache.
15. Explore options to avoid rehydration, use progressive hydration and streaming server-side
rendering for your single-page application.
A huge thanks to Guy Podjarny, Yoav Weiss, Addy Osmani, Artem Denysov, Denys Mishunov, Ilya Pukhalski,
Jeremy Wagner, Colin Bendell, Mark Zeman, Patrick Meenan, Leonardo Losoviz, Andy Davies, Rachel Andrew,
Anselm Hannemann, Patrick Hamann, Andy Davies, Tim Kadlec, Rey Bango, Matthias Ott, Peter Bowyer, Phil
Walton, Mariana Peralta, Philipp Tellis, Ryan Townsend, Ingrid Bergman, Mohamed Hussain S H, Jacob
Groß, Tim Swalling, Bob Visser, Kev Adamson, Adir Amsalem, Aleksey Kulikov and Rodney Rehm for
reviewing the article, as well as our fantastic community, which has shared techniques and lessons learned
from its work in performance optimization for everybody to use. You are truly smashing!