⚡ Every Web Developer should know performance budgets
A performance budget is a set of constraints that apply to metrics that affect a website's performance. Having budgets helps to ensure your website performs well.
👇 Learn about web performance and performance budgets
▶️ Why is performance important?
Performance is an important part of the user experience, and it can directly impact your business.
User experience has also become a factor in Google page ranking.
Setting a performance budget defines the boundaries for your website.
Quantity metrics are most useful when starting a project. You can define specific limits you do not want to exceed.
Those metrics are beneficial for developers and designers, as some may set boundaries for design decisions.
👇
Typical metrics would be:
🔸 Number of requests
🔸 Maximum payload size of the request
🔸 Number of images
🔸 Number of web fonts, including weights
🔸 Number of scripts
🔸 Maximum size of scripts
🔸 Number of third party scripts
These are the most common I know and use.
👇
Those metrics are mostly only hints about web performance.
If you cross a specific budget, it might not influence your user experience at all.
It probably depends on how you load your data and if you are using critical path rendering.
🔹 Timing metrics
Timing metrics are usually events that are happening during page load.
You are defining a maximum timeframe in which a specific event should have been fired. They are usually in your browser API or a lighthouse report.
👇
Typical timing metrics are:
🔸 DOM Content Loaded event
🔸 Page load event
🔸 First Contentful Paint (FCP)
🔸 Largest Contentful Paint (LCP)
🔸 Time to Interactive (TTI)
🔸 Total blocking time (TBT)
🔹 Rule-based metrics
Rule-based metrics are usually used for lighthouse reports.
You can define specific budgets for the performance audit as an example.
The performance score is mostly built on other metrics already mentioned in timings, making it easier to use.
▶️ What are good performance budget limits?
To define the correct budgets, you want t research competitive websites, look up their metrics and build a baseline to start with.
In most cases, this takes time, finding and analyzing them.
👇 To start right away
In my opinion, a good default for performance budgets are:
- 3.8 seconds until TTI
- Below 200kb data of critical path rendering
- Below 20 requests
These are the defaults I usually use.
▶️ How can you ensure that you are within your boundaries?
Here are three tools to check your budgets at build time:
In case a budget is exceeding the limits, you may want to consider:
- Optimizing your code, maybe you got something unoptimized
- Reconsider a feature, if it is worth compared to your budget
- Reduce a feature until it meets the budget
▶️ Take care of those budgets!
Checking your metrics at the built time is one option. Make sure to track them even more for real users.
Real users may have other conditions which cause those budgets to fail.
Making sure every user can meet your budget is crucial!
✅ That's it. Did this convince you to use performance budgets for your next project?
If you found this thread useful, consider following me @michaelketzer and retweet the first tweet! 🙏
Did I miss something? Please let me know 🙏
• • •
Missing some Tweet in this thread? You can try to
force a refresh
🔍 Every Front-End Developer should know the basics of how Google search works
Suppose you develop a Website you most likely want users to find your page. Optimize your page for Google ensures the correct audience will find your page.
↓ Learn how Google search works
The goal of a website is to be found in Google.
To show your website at Google, it goes through these 3 steps:
🔹 Crawling
🔹 Indexing
🔹 Serving
In this thread, we will take a closer look at all the steps.
{ 1 / 12 }
🔹 Crawling
Crawling is the first step. This is about finding your website in the first place.
Some pages are already known to Google through simple links. You can speed up this step with sitemaps.
Once Google has found your page, Google will crawl it.
⚡ Every Web Developer should know and use WebP images
The WebP image format is considered a next-gen image format and reduces the file size for images by 25-35%.
This is crucial for modern SEO and web performance.
👇 Read more about how to use WebP in seconds.
▶️ What is WebP?
WebP is an image format published by google in 2010.
It creates lossless images that are 26% smaller than PNG's and lossy images 25-34% smaller.
In reality, I have seen over 40% smaller sizes already.
And WebP supports transparency!
{ 1 / 7 }
▶️ What browsers are supporting WebP?
The current support includes all main browsers.
It supports Safari only for iOS or macOS Big Sur 11+.
Using the picture tag ensures compatibility for older browsers and fallback alternatives in other formats!
⚡ Every Web Developer should know how to create next-gen image formats
Serving your images in next-gen formats is crucial to ensure your performance is fantastic and loads fast for any of your users.
👇 Learn how to create images in the next-gen format in seconds
1️⃣ What are next-gen formats?
Next-gen formats are image formats such as
- WebP
- AVIF
- JPEG 2000
- JPEG XR
We will focus on WebP as this has the best support across all browsers and is most used!
2️⃣ What is WebP?
WebP is a next-gen image format published by google in 2010. It creates lossless images that are 26% smaller than PNG's and lossy images 25-34% smaller.
In reality, I have seen over 40% smaller sizes already.