Smashing Magazine - #401: Web Performance

Optimizing time to first byte, debugging CLS, optimizing LCP, React DevTools, priority hints and low-hanging web performance fruits cheatsheet. Issue #401 April 18, 2023 View in the browser

Smashing Newsletter

Dobrý večer Smashing Friends,

What should we focus on when boosting web performance today? Surely we’ve heard about Core Web Vitals and Lighthouse scores, but is it enough to get into the green zone in the Google Search Console? How do we optimize for specific regions in a world where our user base is? And how do we debug long tasks and layout shifts?

In this newsletter, we try to answer at least some of these questions — with a few helpful guides to resolve performance issues in your sites or apps, along with a few low-hanging web performance fruits that you could apply to improve your performance today.

SmashingConf SF 2023
Coming up soon: SmashingConf SF (May 23–26). Can you guess who will be the Mystery Speaker this time?

And we are getting super-duper-excited about our new frontend adventures this year: we have an upcoming Smashing Meets all around JavaScript, and our SmashingConf season is just about to start (in-person/remote):

  • Smashing Meets JavaScript (Apr 25)
    A free community event on JavaScript performance, security and the Canvas API.
  • SmashingConf SF 🇺🇸 (May 23–26)
    All around frontend, web performance, CSS, JavaScript, Next.js and accessibility,
  • New Front-End Adventures 2023 (online, Apr 25–May 9)
    With an overview of the things to keep in mind in frontend these days by Vitaly Friedman,
  • React Performance Masterclass (online, June 29–July 13)
    With an overview of React performance optimization techniques with Ivan Akulov.

And, of course, we’d love to welcome you to our upcoming SmashingConf Freiburg 🇩🇪 and our very first SmashingConf Antwerp 🍫 coming up later this year. Oh my, what an adventure it’s going to be (in a good way!) ;-)

Happy learning and we hope to see you soon, everyone!
Vitaly (@vitalyf)


1. CLS Debugger

We’ve all come across sites where page elements shifted just when we were trying to interact with them. To prevent your users from experiencing unexpected page shifts, you should keep an eye on the Cumulative Layout Shift (CLS) Core Web Vital. The CLS Debugger helps you identify what needs improving in the initial load of your site.

CLS Debugger

The CLS Debugger uses the Layout Instability API in Chromium to detect and measure layout shifts in the viewport between when a page starts loading and when it finishes loading. It visualizes where shifts are happening and gives you a list of HTML elements to find the culprits in the code base. A handy little tool to prevent bad surprises and a bad Core Web Vitals score. (cm)


2. Web Performance Snippets

How to measure the time to first byte of all resources loaded? How to find lazy-loaded images outside of the viewport? How to determine when long tasks happen? Joan León curates a list of useful snippets to get web performance metrics to use in the browser console.

Web Performance Snippets

The collection includes snippets for Core Web Vitals, loading, and interaction. Covering everything from Largest Contentful Paint to time to first byte, script timings, resource hints, font loading, and layout shifts, they offer a quick and easy way to analyze a website’s performance. One for the bookmarks. (cm)


3. Optimizing Time To First Byte

The Time to First Byte (TTFB) metric is a foundational web performance metric. If it’s too high, you risk that TTFB slows down the metrics that follow it — First Contentful Paint or Largest Contentful Paint, for example. But how to assess if the TTFB of your site is problematic? And if it is, how to fix it? Jeremy Wagner wrote a comprehensive post on how to prioritize for Time to First Byte.

Optimize Time to First Byte

In “Optimize Time to First Byte,” Jeremy shares different strategies for getting things faster on the server side. Since no article can encapsulate every combination of backend application stacks, the post doesn’t provide stack-specific guidance but focuses on optimizations that apply to most architectures. A great overview of effective options to explore and try. (cm)


4. Upcoming Workshops and Conferences

That’s right! We run online workshops on frontend and design, be it accessibility, performance, or design patterns. In fact, we have a couple of workshops coming up soon, and we thought that, you know, you might want to join in as well.

Smashing Online Events
With online workshops, we aim to give you the same experience and access to experts as in an in-person workshop from wherever you are.

As always, here’s a quick overview:


5. Priority Hints And Improving LCP

Browsers usually determine a request’s priority by its type and position in the document markup. If you want to change this default priority, let’s say because the browser queues your Largest Contentful Paint (LCP) image, it might be a good idea to experiment with Priority Hints to reduce the waiting time. Kevin Farrugia wrote a great introduction to how Priority Hints work and what to watch out for.

Priority Hints and Optimizing LCP

In his post, Kevin shows in detail how to use fetchpriority to increase or decrease the priority of an element and, particularly, how to use it to load an LCP image faster. A fallback using preload prioritizes your LCP image in Firefox where fetchpriority isn’t supported yet. (cm)


6. Low-Hanging Web Performance Fruits

When you want to improve the performance of a site or app, it’s easy to go down the rabbit hole as there’s always something else you could optimize. Luckily, there are also some low-hanging web performance fruits, things that can be done relatively easily but have a meaningful impact on performance.

Low-Hanging Web Performance Fruits: A Cheat Sheet

Artem Perchyk wrote a cheat sheet for optimizations that don’t require you to mess with the existing code base aside from the configuration and a few imports. He describes five low-hanging fruits in detail: optimizing your assets, caching your assets, splitting your code, optimizing your bundle, and managing third-party scripts. While some of these things might sound basic and obvious, they are often forgotten in actual projects. A great reminder.

If you want to dive a bit deeper into optimizing for Core Web Vitals, the Chrome DevRel team summarized the most effective ways and best practices to improve performance for your users. The collection only features recommendations that have the largest real-world impact, are relevant and applicable to most sites, and realistic for most developers to implement. (cm)


From our sponsor

Reduce The Drift Between Design And Production

Reduce the Drift Between Design and Production
Design. Collaborate. Deliver better customer experiences. Make sure what you designed, actually gets into production with Centra, a free tool from Applitools—the leader in AI-powered testing, trusted by the world's best frontend teams to accelerate delivery, protect their brands, and ensure flawless digital experiences. Create your free account today.


7. Fast Is Good, Instant Is Better

Due to its nature of being a request/response medium, there is an inherent delay to web browsing, no matter how fast we make our pages. So how much can we reduce this natural delay? Can we give our users an experience where the load is not just acceptable but completely unnoticeable? As Barry Pollard shows, there are a couple of technologies that make the seemingly impossible possible.

Fast Is Good, Instant Is Better

In his post “Fast Is Good, Instant Is Better,” Barry describes three technologies that have the potential for drastically improving the user experience of the web. As he points out, being aware of them and ensuring your websites can use them is crucial to not waste any performance gains you can get for free. A must-read that prevents you from making your performance endeavors needlessly tough. (cm)


8. Getting Started With React DevTools

So you’ve built a shiny new React app and notice that some components are rendering slowly. It could be a large list or a dropdown, for example. React Developer Tools is a powerful browser extension that helps you identify the root cause of performance issues like these. Available for Chrome and Firefox, it provides a detailed analysis of each component’s performance and rendering times.

Getting Started with React DevTools in Chrome

If you want to dive deeper into how React DevTools works, Piero Borrelli looks at the debugging tools in more detail. He summarizes everything you need to know to get started and demonstrates the tools’ functionalities through an example app. A handy little helper to uncover and fix performance bottlenecks. (cm)


9. New On Smashing Job Board


10. Recent Smashing Articles


That’s All, Folks!

Thank you so much for reading and for your support in helping us keep the web dev and design community strong with our newsletter. See you next time!


This newsletter issue was written and edited by Cosima Mielke (cm), Vitaly Friedman (vf) and Iris Lješnjanin (il).


Sent to truly smashing readers via Mailchimp.
We sincerely appreciate your kind support. You
rock.

Follow us on Twitter Join us on Facebook

unsubscribe update preferences view in your browser

Older messages

#400: Useful Templates For UX Designers

Tuesday, April 11, 2023

With usability testing Notion templates, UX research templates, UX questions bank and tools for better thinking. Issue #400 • April 11, 2023 • View in the browser Smashing Newsletter Selamat petang

#399: Web Accessibility

Tuesday, April 4, 2023

With accessibility tools, handbook, annotation kit, checklists, free courses and accessibility posters for free download. Issue #399 • April 4, 2023 • View in the browser Smashing Newsletter Boa noite

#398: Knowledge Hubs For UX Designers

Tuesday, March 28, 2023

Useful hubs on accessibility, design, UX research, design toolkits and front-end components — all neatly packed in one single newsletter. Issue #398 • Mar 28, 2023 • View in the browser Smashing

#397: Sustainable Design Toolkits 🌱

Tuesday, March 21, 2023

With sustainability checklists, Figma kit, ethical design, sustainability-related nudges in design and useful resources all around prioritizing what matters and reducing waste. Issue #397 • Mar 21,

#396: Web Typography

Tuesday, March 14, 2023

With the typography cheat sheet, type combinations, the right font-size, free eBooks on typography and fonts in data visualization. Issue #396 • Mar 14, 2023 • View in the browser Smashing Newsletter

You Might Also Like

At Home With Gloria Steinem

Thursday, December 26, 2024

View in your browser | Update your preferences ADPro Glory, Gloria Every year our AD100 honorees fill out a survey of projects that they're working on. A year or so ago, longtime AD100 designer

Celeb Homes at the Holidays—and a Few More Things to Make You Merry

Tuesday, December 24, 2024

View in your browser | Update your preferences ADPro Holiday Cheer Whether your taste leans traditional, modern, or all-out extravagant, AD is rife with inspiration for your holiday. In the spirit of

#488: Fun And Useful Gems

Tuesday, December 24, 2024

Radio garden, Zoom backgrounds, visual history of the alphabet and fun interactive experiences. Issue #488 • Dec 24, 2024 • View in the browser Smashing Newsletter Hello Smashing Friends, As we are

Accessibility Weekly #428: Putting AI to the (Accessibility) Test

Monday, December 23, 2024

December 23, 2024 • Issue #428 View this issue online or browse the full issue archive. Hey accessibility friends! It's the time of year where news and information slows down as many people take

2024 magic moments

Sunday, December 22, 2024

Issue 225: The year from my personal lens ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Planning mode

Friday, December 20, 2024

Lessons from our first-ever annual planning sprint ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

We Co-Sign This AD100-Approved Trend

Thursday, December 19, 2024

View in your browser | Update your preferences ADPro Emboldening the Bath Marble, marble, everywhere, and every drop is chic. According to AD100 designer Jake Arnold, “material drenching”—that is,

177 / Keep calm by listening to these ambient sounds

Thursday, December 19, 2024

Product Disrupt Logo Product Disrupt Half-Monthly Dec 2024 • Part 1 View in browser Welcome to Issue 177 Lately, I've been driving a lot of inspiration from the things I see in real life. The range

The Year in Color: Hella Jongerius, Mocha Mousse, and More

Thursday, December 19, 2024

View in your browser | Update your preferences ADPro Color Our World Since the summer, AD PRO has kept its finger on the pulse of color predictions. Overall, the vibe right now is down to earth,

🐺Get Media Features in 2025

Thursday, December 19, 2024

A BIG Wolf Craft announcement!! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏