Skip to content

Commit

Permalink
Add note on minimising unused code
Browse files Browse the repository at this point in the history
This feels like an omission – minimising any unused code should be a 'high priority' task when it comes to web performance
  • Loading branch information
36degrees authored May 29, 2024
1 parent 9b165de commit 67e72e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/standards/optimise-frontend-perf.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ For example:
| #High | Position assets correctly | [Set styles at the top of the page][] and [`defer` scripts][]. |
| | Compress static resources | [Minify][] CSS and JavaScript and use a compression algorithm like [Gzip][] and [Brotli][] on assets. |
| | Set correct Headers | Set correct [Cache-Control][] and [ETag][] headers on assets for optimal caching. |
| | Minimise unused code | Avoid including CSS and JavaScript that is not used on your site. |
| #Medium | Include `width` and `height` attributes on images to minimise layout thrashing | Make sure to include these attributes to improve visual stability and the [Cumulative Layout Shift (CLS)][] metric. |
| | Minimise TCP connections | Use fewer third-party domains to reduce the number of DNS + TCP + SSL negotiations per page. |
| | Investigate [lazy loading][] | For pages with many images, only load images in the immediate browser viewport. |
| | Investigate the impact of loading [@font-face][] assets on perceived performance | Use the CSS `font-display` property or other [font-loading strategies][] to manage common issues like [FOUT, FOIT and FOFT][]. |
| | Minimise HTTP requests | Minimise the number of CSS and JavaScript files to reduce the number of round-trips to the server. See ‘Code splitting’ below. |
| | Minimise HTTP requests | Minimise the number of CSS and JavaScript files to reduce the number of round-trips to the server. See ‘Code splitting’ below. |
| #Low | Reduce cookie size | Because every cookie is sent with each HTTP request, enable HTTP/2 to enable HPACK header compression or HTTP/3 for QPACK. |
| | Investigate using a Content Delivery Network (CDN) | A CDN will improve site performance by using a network of servers to deliver resources to users. The user will get delivered resources from the server that is located nearest to the user. A CDN is well-suited to handling heavy traffic and traffic spikes. |
| | Keep JSON payloads small | Avoid adding too much data to JSON objects, as parsing them can be slow. |
Expand Down

0 comments on commit 67e72e2

Please sign in to comment.