DEV Community

Cover image for The Ultimate Guide to Web Performance πŸš€
ender minyard
ender minyard

Posted on • Updated on

The Ultimate Guide to Web Performance πŸš€

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


✨ 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


⭐️ 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


✨ 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


πŸ’« 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


πŸ’« 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


β˜€οΈ 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


⭐️ 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

Did I miss something? Comment any potential additions to the list!

Discussion (38)

dmahely profile image
Doaa Mahely

machineno15 profile image
Tanvir Shaikh

This deserves a github repository .
like Awesome web performance..

mketlinger profile image
Mike Etlinger

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.

ender_minyard profile image
ender minyard Author


mketlinger profile image
Mike Etlinger

Nice thanks! I didn’t know about that Library.

joelbonetr profile image

z2lai profile image

Just dope?

joelbonetr profile image

What can I say, it's just what I needed to do that πŸ˜†

Thread Thread
z2lai profile image

Yo that's dope.

Thread Thread
joelbonetr profile image

Just dope?

miqueasgutierrez profile image

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:

harrytheo profile image
Harry Theo

Amazing list you put there!! πŸŽ‰πŸŽ‰ Thank you!

I have a few additions there you might want to include:

jurjin profile image
Giorgio Tempesta • Edited on

I would add this one: Serve Modern Code to Modern Browsers for Faster Page Loads

ender_minyard profile image
ender minyard Author

That's already in the article :-)

jurjin profile image
Giorgio Tempesta

Sorry I completely missed it! πŸ™ƒ

qainsights profile image
NaveenKumar Namachivayam ⚑

Excellent list. Please add JMeter under testing tools.

rowemore profile image
Rowe Morehouse

You could add a critical-path sections, there may be some tools / techniques here for you to add to yours:


ender_minyard profile image
ender minyard Author

The article already links to Addy Osmani's Critical library.

oscarrodar profile image
Oscar Rodriguez Arroyo

Nice!!! Thanks

yogionbioinformatics profile image
Yogindra Raghav

How long did this take you to prepare?

uploadcare profile image

Impressive, thank you! We've also published a guide to responsive images and adaptive delivery technology, an easier way to serve responsive images:

Btw, if you're looking for a CDN for a media-heavy platform, here's a comparison of the 10 best solutions:

edwardinchains profile image

content-visibility - limited browser support right now.

rahulh123 profile image

How many of these amazing posts do you make? πŸ˜€ I guess I just got to go read all of them.

ender_minyard profile image
ender minyard Author

:-) thanks!

juliomoreyra profile image

Impressive list, very complete!

ikushlianski profile image
Ilya Kushlianski

To lazy loading, I'd also add the browser implementation described at

adilvelizade0 profile image
Info Comment hidden by post author - thread only accessible via permalink
Adil Velizade

Please follow instagram : @master_javascript

keefdrive profile image

Thanks I can create my own checklist now

ashvin777 profile image
Ashvin Kumar Suthar

This is very useful list

vuongtran profile image
Vuong Tran

Awesome list for web perf

mezmo profile image

The suggestion to combine CSS and other types of files, is that still true in the age of http2 and the probably soon coming of http3?

ender_minyard profile image
ender minyard Author • Edited on

HTTP requests are still expensive. I personally make an exception to bundling for very large JS files (which you should avoid in the first place). In the past, with benchmarking, I found that bundling small files = performance gains but bundling large JS files = more execution time.

There are limitations to bundling due to file size, but also, HTTP/2 adoption isn't universal. You may be interested in this other article about bundling.

There is definitely a way to bundle correctly. For example, if you generate different bundles on every build, you have to consider that the user never gets to cache your assets.

miteshkamat27 profile image
Mitesh Kamat

Thanks a ton for collating them.

mjcoder profile image
Mohammad Javed

That's just awesome. πŸ‘πŸ’―

ninetails profile image
Carlos Kazuo

Also a follow up: add AVIF format to images

ender_minyard profile image
ender minyard Author


Some comments have been hidden by the post's author - find out more