# ๐ฎ Front-End Performance Checklist The only Front-End Performance Checklist that runs faster than the others! Performance is a huge subject, but it's not always a "back-end" or an "admin" topic: it's a Front-End responsibility too. The Front-End Performance Checklist is an exhaustive list of elements you should check or at least be aware of, as a Front-End developer and apply to your project (personal and professional). > One simple rule: "Design and code with performance in mind" **Other Checklists:** - [๐ Front-End Checklist](https://github.com/thedaviddias/Front-End-Checklist#front-end-checklist) - [๐ Front-End Design Checklist](https://github.com/thedaviddias/Front-End-Design-Checklist#front-end-design-checklist) > [!TIP] > โญ๏ธ I've recently launched [UX Patterns for Devs](https://git.new/uxpatterns) and a [curated list for indie developers](https://git.new/indiedevtoolkit), feel free to check it out! โญ๏ธ ## ๐ Table of Contents - [How to use?](#how-to-use) - [HTML](#html) - [CSS](#css) - [Fonts](#fonts) - [Images](#images) - [JavaScript](#javascript) - [Performance Tools](#performance-tools) - [References](#references) ## How to use? For each rule, you will have a paragraph explaining _why_ this rule is important and _how_ you can fix it. For more deep information, you should find links that will point to ๐ tools, ๐ articles or ๐น medias that can complete the checklist. All items in the **Front-End Performance Checklist** are essentials to achieve the highest performance score but you would find an indicator to help you to eventually prioritised some rules amount others. There are 3 levels of priority: - ![Low][low] means that the item has a **low** priority. - ![Medium][medium] means that the item has a **medium** priority. You shouldn't avoid tackling that item. - ![High][high] means that the item has a **high** priority. You can't avoid following that rule and implement the corrections recommended. ### Performance tools List of the tools you can use to test or monitor your website or application: - ๐ [WebPagetest - Website Performance and Optimization Test](https://www.webpagetest.org/) - ๐ โ [Dareboost: Website Speed Test and Website Analysis](https://www.dareboost.com/) (use the coupon WPCDD20 for -20%) - ๐ [Treo: Page Speed Monitoring](https://treo.sh/?ref=perfchecklist) - ๐ [GTmetrix | Website Speed and Performance Optimization](https://gtmetrix.com/) - ๐ [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) - ๐ [Web.dev](https://web.dev/measure) - ๐ [Pingdom Website Speed Test](https://tools.pingdom.com) - ๐ [Make the Web Fasterย | Google Developers](https://developers.google.com/speed/) - ๐ [Sitespeed.io - Welcome to the wonderful world of Web Performance](https://www.sitespeed.io/) - ๐ [Calibre](https://calibreapp.com/) - ๐ [Website Speed Test | Check Web Performance » Dotcom-Tools](https://www.dotcom-tools.com/website-speed-test.aspx) - ๐ [Website and Server Uptime Monitoring - Pingdom](https://www.pingdom.com/product/uptime-monitoring/) ([Free Signup Link](https://www.pingdom.com/free)) - ๐ [Uptime Robot](https://uptimerobot.com) - ๐ [SpeedCurve: Monitor front-end performance](https://speedcurve.com) - ๐ [PWMetrics - CLI tool and lib to gather performance metrics](https://github.com/paulirish/pwmetrics) - ๐ [Lighthouse - Google](https://developers.google.com/web/tools/lighthouse/#devtools) - ๐ [Checkbot browser extension - Checks for web performance best practices](https://www.checkbot.io/) - ๐ [Yellow Lab Tools | Online test to help speeding up heavy web pages](https://yellowlab.tools/) - ๐ [Speedrank - Web Performance Monitoring](https://speedrank.app/) - ๐ [DebugBear - Monitor website performance and Lighthouse scores](https://www.debugbear.com/) - ๐ [Gravity CI - Check your build artifacts sizes on every pull request.](https://gravity.ci/) - ๐ [Exthouse - Analyze the impact of a browser extension on web performance](https://github.com/treosh/exthouse) - ๐ [LogRocket - Measure front-end performance in production apps](https://logrocket.com) ### References - ๐ [The Cost Of JavaScript](https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4) - [AddyOsmani.com - Start Performance Budgeting](https://addyosmani.com/blog/performance-budgets/) - ๐ [Get Started With Analyzing Runtime Performance ย |ย Google Developers](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/) - ๐ [State of the Web | 2018_01_01](https://httparchive.org/reports/state-of-the-web?start=2018_01_01) - ๐ [Page Weight Doesn't Matter](https://www.speedshop.co/2015/11/05/page-weight-doesnt-matter.html) - ๐ [Front-End Performance Checklist 2021 [PDF, Apple Pages, MS Word]](https://www.smashingmagazine.com/2021/01/front-end-performance-2021-free-pdf-checklist/) - ๐ [Designing for Performance Weighing Aesthetics and Speed - By Lara Callender Hogan [eBook, Print]](http://designingforperformance.com/index.html) - ๐ [fabkrum/web-performance-resources: Up to date collection of valuable web performance resources](https://github.com/fabkrum/web-performance-resources) - ๐ [Checkbot - Web Speed Best Practices](https://www.checkbot.io/guide/speed/) - ๐ [Progressive Tooling - A list of community-built, third-party tools that can be used to improve page performance](https://progressivetooling.com/) ## HTML ![html] - [ ] **Minified HTML:** ![medium] The HTML code is minified, comments, white spaces and new lines are removed from production files. _Why:_ > Removing all unnecessary spaces, comments and attributes will reduce the size of your HTML and speed up your site's page load times and obviously lighten the download for your user. _How:_ > Most of the frameworks have plugins to facilitate the minification of the webpages. You can use a bunch of NPM modules that can do the job for you automatically. - ๐ [HTML minifier | Minify Code](http://minifycode.com/html-minifier/) - ๐ [Online HTML Compressor](http://refresh-sf.com) - ๐ [Experimenting with HTML minifier โ Perfection Kills](http://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype) - [ ] **Place CSS tags always before JavaScript tags:** ![high] Ensure that your CSS is always loaded before having JavaScript code. ```html ``` _Why:_ > Having your CSS tags before any JavaScript enables better, parallel download which speed up browser rendering time. _How:_ > โ Ensure that `` and `` in a single line (minified if possible). _Why:_ > Inlining critical CSS help to speed up the rendering of the web pages reducing the number of requests to the server. _How:_ > Generate the CSS critical with online tools or using a plugin like the one that Addy Osmani developed. - ๐ [Understanding Critical CSS](https://www.smashingmagazine.com/2015/08/understanding-critical-css/) - ๐ [Critical by Addy Osmani on GitHub](https://github.com/addyosmani/critical) automates this. - ๐ [Inlining critical CSS for better web performance | Go Make Things](https://gomakethings.com/inlining-critical-css-for-better-web-performance/) - ๐ [Critical Path CSS Generator - Prioritize above the fold content :: SiteLocity](https://www.sitelocity.com/critical-path-css-generator) - ๐ [Reduce the size of the above-the-fold content](https://developers.google.com/speed/docs/insights/PrioritizeVisibleContent) - [ ] **Embedded or inline CSS:** ![high] Avoid using embed or inline CSS inside your `
` \_(Not valid for HTTP/2) _Why:_ > One of the first reason it's because it's a good practice to **separate content from design**. It also helps you have a more maintainable code and keep your site accessible. But regarding performance, it's simply because it decreases the file-size of your HTML pages and the load time. _How:_ > Always use external stylesheets or embed CSS in your `` (and follow the others CSS performance rules) - [ ] **Analyse stylesheets complexity:** ![high] Analyzing your stylesheets can help you to flag issues, redundancies and duplicate CSS selectors. _Why:_ > Sometimes you may have redundancies or validation errors in your CSS, analysing your CSS files and removed these complexities can help you to speed up your CSS files (because your browser will read them faster) _How:_ > Your CSS should be organized, using a CSS preprocessor can help you with that. Some online tools listed below can also help you analysing and correct your code. - ๐ [TestMyCSS | Optimize and Check CSS Performance](http://www.testmycss.com/) - ๐ [CSS Stats](https://cssstats.com/) - ๐ [macbre/analyze-css: CSS selectors complexity and performance analyzer](https://github.com/macbre/analyze-css) - ๐ [Project Wallace](https://www.projectwallace.com/) is like CSS Stats but stores stats over time so you can track your changes **[โฌ back to top](#-table-of-contents)** ## Fonts ![fonts] - ๐ [A Book Apart, Webfont Handbook](https://abookapart.com/products/webfont-handbook) - [ ] **Webfont formats:** ![medium] You are using WOFF2 on your web project or application. _Why:_ > According to Google, the WOFF 2.0 Web Font compression format offers 30% average gain over WOFF 1.0. It's then good to use WOFF 2.0, WOFF 1.0 as a fallback and TTF. _How:_ > Check before buying your new font that the provider gives you the WOFF2 format. If you are using a free font, you can always use Font Squirrel to generate all the formats you need. - ๐ [WOFF 2.0 โ Learn more about the next generation Web Font Format and convert TTF to WOFF2](https://gist.github.com/sergejmueller/cf6b4f2133bcb3e2f64a) - ๐ [Create Your Own @font-face Kits ยป Font Squirrel](https://www.fontsquirrel.com/tools/webfont-generator) - ๐ [IcoMoon App - Icon Font, SVG, PDF & PNG Generator](https://icomoon.io/app/) - ๐ [Using @font-face | CSS-Tricks](https://css-tricks.com/snippets/css/using-font-face/?ref=frontendchecklist) - ๐ [Can I use... WOFF2](https://caniuse.com/woff2) - [ ] **Use `preconnect` to load your fonts faster:** ![medium] ```html ``` _Why:_ > When you arrived on a website, your device needs to find out where your site lives and which server it needs to connect with. Your browser had to contact a DNS server and wait for the lookup complete before fetching the resource (fonts, CSS files...). Prefetches and preconnects allow the browser to lookup the DNS information and start establishing a TCP connection to the server hosting the font file. This provides a performance boost because by the time the browser gets around to parsing the css file with the font information and discovering it needs to request a font file from the server, it will already have pre-resolved the DNS information and have an open connection to the server ready in its connection pool. _How:_ > โ Before prefetching your webfonts, use webpagetest to evaluate your website