There's so many ways to speed up your site. Don't you wish every web performance tip was in one place? That's what I thought too, so I put them all in one place: this post.
Use this guide as a reference.
Table Of Contents
HTML
β¨ Minify HTML
βοΈ Order your styles and scripts for pagespeed
β‘οΈ Eliminate render-blocking resources
π Minimize layout thrashing
π Prioritize resources
β¨ Preload critical assets to improve loading speed
π₯ Establish network connections early
β‘οΈ Prefetch resources
π Implement adaptive serving
CSS
βοΈ Minify CSS
β¨ Remove unused CSS
π₯ Defer non-critical CSS
β‘οΈ Minimize CSS requests by combining external CSS
π Optimize CSS background images with media queries
βοΈ Avoid CSS inside the body tag
βοΈ Inline critical CSS
β¨ Avoid expensive styles
π« Optimize CSS length
Images
β¨ Choose the right image format
π« Choose the correct level of compression
βοΈ Use Imagemin to compress images
π₯ Defer offscreen images
β‘οΈ Properly size images
β¨ Replace animated gifs with video
π Serve responsive images
β‘οΈ Serve images with correct dimensions
π Use WebP images
β‘οΈ Use AVIF images
π Use image CDNs to optimize images
β¨ Use lazy-loading
π Lazy-loading video
β‘οΈ Use lazysizes to lazy-load images
βοΈ Compress JPEG images
π₯ Optimize PNG images
β¨ Optimize SVG vector files
Fonts
π« Avoid invisible text during font loading
π₯ Use preconnect to load fonts faster
β‘οΈ Optimize Webfont loading and rendering
βοΈ Reduce Webfont Size
β¨ Keep Webfont size under 300kb
JavaScript
π« Apply the PRPL pattern
βοΈ Limit the size of NPM dependencies
β‘οΈ Use code splitting
π Combine external JavaScript
π₯ Remove unused code
π Use tree-shaking in Webpack
β¨ Minify JavaScript
π« Serve modern code to modern browsers
π See how CommonJS makes your bundles larger
β‘οΈ Defer loading JavaScript
βοΈ Prefer Vanilla JavaScriptπ
π‘ Use service workers to cache data
π Use web workers
π₯ Write optimized code for V8
π Compile your JavaScript to faster JavaScript with Prepack
β¨ Compile your JavaScript to faster JavaScript with Closure Compiler
Server
βοΈ Use HTTPS
βοΈ Keep the size of cookies low as possible
π₯ Avoid bad requests
π« Set HTTP cache headers
βοΈ Enable gzip and brotli compression
β‘οΈ Self-host your static asssets
π Enable OCSP stapling
π₯ Adopt IPv6
π‘ Serve assets over HTTP/2
π Implement HPACK compression
β¨ Set proper security headers
Testing Tools
π« Measure site speed with Pingdom
π Measure site speed with WebPageTest
π Measure performance with the RAIL model
β‘οΈ Configure Webpack performance hints
βοΈ Use bundlesize
π₯ Measure JavaScript execution time
π Use lighthouse-ci
βοΈ Use Lighthouse Bot to set a performance budget
βοΈ Test on remote real devices
π₯ Use Sitespeed
β¨ Use Calibre
π« Use SpeedCurve
π Use k6
β‘οΈ Use SpeedTracker
Frameworks
βοΈ Use an ahead of time compiler
π₯ Improve Angular performance
βοΈ Debug React perfomance
π₯ Eliminate common React issues
β¨ Make components connection aware
π« Implement adaptive serving
π Serve Adaptive Components Using the Network Information API
Top comments (37)
This deserves a github repository .
like Awesome web performance..
Nice! Lots of goodies in here and this is a great checklist.
The CSS section should have something like:
βInline Your Critical CSSβ which reduces the number of requests and helps with render blocking.
Done!
Nice thanks! I didnβt know about that Library.
Just dope?
What can I say, it's just what I needed to do that π
Yo that's dope.
Just dope?
Recursion
Amazing list you put there!! ππ Thank you!
I have a few additions there you might want to include:
Hello, very good advice, it is also important to integrate Push Notifications in your website or online store for greater performance in the communication area, to carry out Ad campaigns, promotions, events, etc., I invite you to use the Indigital Service, you can carry out Marketing Campaigns Free for 30,000 devices, it is excellent and very easy to install, here is the Documentation: docs.indigitall.com/es/
THIS IS A GODSEND!!!!!!!!
How long did this take you to prepare?
Impressive, thank you! We've also published a guide to responsive images and adaptive delivery technology, an easier way to serve responsive images: dev.to/uploadcare_/a-practical-gui...
Btw, if you're looking for a CDN for a media-heavy platform, here's a comparison of the 10 best solutions: bit.ly/3oYxr5E
content-visibility - limited browser support right now.
web.dev/content-visibility/
caniuse.com/css-content-visibility
How many of these amazing posts do you make? π I guess I just got to go read all of them.
:-) thanks!
Some comments have been hidden by the post's author - find out more