Building a Fast Website for Every Single Visitor

Rate this content
Bookmark

Learn how to build fast, adaptive web applications that dynamically respond to user conditions and context in this informative talk. Discover the principles and techniques behind adaptive design, including responsive layouts and dynamic interactions, optimized for different browsers, device strengths, internet speeds, screen sizes, and user preferences. Explore the role of data-driven decision-making and user analytics in tailoring content and features quickly and efficiently based on these variables. Gain practical insights into implementing fast, adaptive web apps using various technologies and frameworks. Understand the significance of user testing and feedback loops in refining the application for a seamless and speedy user experience. Walk away with actionable strategies to create personalized, high-performance web experiences that drive engagement and success.

This talk has been presented at React Advanced 2024, check out the latest edition of this React Conference.

FAQ

Developers can use the 'window.navigator.deviceMemory' API to get an approximate number of gigabytes of RAM on the user's device, allowing them to tailor the user experience accordingly.

The talk focuses on building a fast and accessible website for every user, emphasizing the importance of considering user perception and adaptive implementation.

User perception is crucial because it varies depending on the user's context, such as their device and connection speed, which affects how fast or slow a website feels to them.

The Aurora project collaborates with frameworks to optimize image delivery, providing an image component that is optimized out of the box for better performance.

The 'Effective Type' API gives an estimate of the user's network conditions (like 4G or 3G). It is controversial due to privacy concerns, as it can potentially be used to infer a user's location and movements.

Browser list helps bundlers like Webpack and Babel to know which features to polyfill or transpile, ensuring compatibility with the specified browsers and reducing unnecessary code.

A user's internet connection speed can drastically impact how quickly a website loads, affecting their overall experience. Developers can use APIs to detect connection speed and adjust content delivery accordingly.

The 'Hardware Concurrency' API provides the number of logical processor cores, helping developers optimize performance by tailoring resource-intensive tasks based on the user's device capabilities.

The two methods are lab testing, which simulates user experience, and field testing (or real user monitoring), which collects real data from users.

Developers can use responsive images with the 'source set' attribute to provide different image sizes for different devices, ensuring better performance and user experience.

Medhat Dawoud
Medhat Dawoud
31 min
25 Oct, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
This talk focuses on building a fast and accessible website for all users, highlighting the importance of performance and user experience optimization. It emphasizes the need for adaptive implementation to cater to different devices and user conditions. The talk also discusses the factors beyond the developer's control, such as screen size, browsers, devices, internet connection, and sitting position. It highlights the significance of optimizing image components for various devices and the role of browser support and rendering engines. The speaker discusses the use of future APIs and the challenges of browser compatibility, as well as optimizing image formats and bundler compatibility. The talk provides insights on controlling bundler and device compatibility, optimizing CPU usage, internet connection, and JavaScript form submission. It concludes with a proposal to respond with save data instead of effective type for limited internet connections and recommends using React with adaptive hooks for better user experiences. Overall, the talk covers essential aspects of building a fast and accessible website.

1. Building a Fast and Accessible Website

Short description:

Hello, everyone. This talk is about building a fast and accessible website for every visitor. We cannot control various aspects of the user's browsing experience, such as screen size, internet connection, browser version, and device strength. As developers, we have the privilege of using the latest technology, but there is one thing we should not simulate: the user's sitting position. Building a fast website is essential, but accessibility is equally important. Let me introduce myself as Mehtad Dawood, a senior software engineer at Miro and a Google developer expert in performance.

Hello, everyone. It's so good to be here for the first time speaking in the UK. So hi, London. And hi to the people watching us online and people who are going to watch us later on in recording as well.

This talk as a disclaimer is a bit longer. So if you'd like to find me to ask questions later on, if I couldn't pick up anything on the stage, please find me anyway, not only afterwards, during the day I'll be available.

This talk is about building a fast website for every single visitor. And every single visitor is a part that I'm going to just make it emphasized today. And I will start with a quick question. What makes a web user so special, so challenging? I will answer this one. So we have some stuff that we cannot control as web developers or engineers, especially where they are going to browse your website, in which screen size, which internet connection, even without internet connection sometime, which browser, not even which browser, which browser version, we cannot control that. And also what device they are using, how strong or weak the device they are using. Not even we can control how they are sitting browsing your website, right?

In the other hand, we developers are very privileged. We should feel that because we always use the latest technology, latest devices, and we need that. There's a reason for that. We're running a lot of hard things and we're running the best internet usually, let's say. And tend to use the latest version of any browser so we can make use of any UI. However, there is only one thing that we are simulating the user for, and we should not, which is a sitting position. This is the only thing we don't need, but there you go.

So we need not only to build a fast website for every single visitor, we need it also to be more accessible. It's all about accessibility here. It's not only about being fast. Fast is only one factor of that.

So allow me to introduce myself. Thanks Matim for giving an introduction. My name is Mehtad Dawood. I'm a senior software engineer working for Miro. And I'm also a Google developer expert in performance. If you like what you see today, you can follow me on Twitter or find some articles I'm writing on my blog. So let's jump back to what we do.

2. Optimizing Performance and User Experience

Short description:

Performance depends on user perception. Different modes of transport may appear faster or slower depending on the observer's perspective. To measure performance, there are two ways: lab testing, which simulates the user experience but is not accurate, and field testing or real user monitoring, which provides detailed information about user behavior and device distribution. It is important to personalize the website experience based on user needs and optimize for accessibility. Choose a target and aim to build a great user experience.

Performance only depends on the user perception. There is no, nothing that you can perceive similar to what I can perceive. So imagine yourself on a skateboard and you have seen someone with a bike. What you would feel? He's faster than you, right? And if you're in a bike and you see someone in a car, he's still, this is faster than you. But if you are in the car and you see someone in a Ferrari, you'll feel that still he's getting faster. So it depends really where you are. Every time you are on the right and moving to the left, you feel that this is faster and all the way around. If you are in the car, you will feel the cyclist is even slower. So just to make sure that you understand this one. So would a motor bike or motorcycle would be faster or slower? It's really depending where you are. Right? So for those people, you will feel that, okay, this is relatively slower. Okay. And for those people who will feel this is fast. So we need to learn how and where the user stands.

To measure performance, simply we have two basic ways. First one is lab testing, which is you are simulating how the user is going to experience this, and you have to have enough data to decide whether it is fast or slow, how they are doing that. And this is not accurate. It really depends again on your great devices that you're using. You do have a M1, you look for M2 or M3 and the behavior based on lab testing for an M3 is different than an Intel. I'm talking from experience and the other way, which I'm more interested in today, which is field testing or also known as Rome testing, real user monitoring. And for this one, you get tons of information, including core vitals, different metrics. You get also device distribution. You also get the connection distribution. And you will be surprised if you run this on your website or any application that you're building. You'll find a lot of people are still using 3G or 2G, so it's not very accessible for them. And based on this information, you will recognize that there's no one size fits all. You have to make it very personalized for the user and how they are feeling your website. It's all about perception again. So you need to pick a target. Either you build it for the best user conditions and you build the glory user experience.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

A Guide to React Rendering Behavior
React Advanced 2022React Advanced 2022
25 min
A Guide to React Rendering Behavior
Top Content
This transcription provides a brief guide to React rendering behavior. It explains the process of rendering, comparing new and old elements, and the importance of pure rendering without side effects. It also covers topics such as batching and double rendering, optimizing rendering and using context and Redux in React. Overall, it offers valuable insights for developers looking to understand and optimize React rendering.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
React Concurrency, Explained
React Summit 2023React Summit 2023
23 min
React Concurrency, Explained
Top Content
Watch video: React Concurrency, Explained
React 18's concurrent rendering, specifically the useTransition hook, optimizes app performance by allowing non-urgent updates to be processed without freezing the UI. However, there are drawbacks such as longer processing time for non-urgent updates and increased CPU usage. The useTransition hook works similarly to throttling or bouncing, making it useful for addressing performance issues caused by multiple small components. Libraries like React Query may require the use of alternative APIs to handle urgent and non-urgent updates effectively.
The Future of Performance Tooling
JSNation 2022JSNation 2022
21 min
The Future of Performance Tooling
Top Content
Today's Talk discusses the future of performance tooling, focusing on user-centric, actionable, and contextual approaches. The introduction highlights Adi Osmani's expertise in performance tools and his passion for DevTools features. The Talk explores the integration of user flows into DevTools and Lighthouse, enabling performance measurement and optimization. It also showcases the import/export feature for user flows and the collaboration potential with Lighthouse. The Talk further delves into the use of flows with other tools like web page test and Cypress, offering cross-browser testing capabilities. The actionable aspect emphasizes the importance of metrics like Interaction to Next Paint and Total Blocking Time, as well as the improvements in Lighthouse and performance debugging tools. Lastly, the Talk emphasizes the iterative nature of performance improvement and the user-centric, actionable, and contextual future of performance tooling.
A Framework for Managing Technical Debt
TechLead Conference 2023TechLead Conference 2023
35 min
A Framework for Managing Technical Debt
Top Content
Today's Talk discusses the importance of managing technical debt through refactoring practices, prioritization, and planning. Successful refactoring requires establishing guidelines, maintaining an inventory, and implementing a process. Celebrating success and ensuring resilience are key to building a strong refactoring culture. Visibility, support, and transparent communication are crucial for addressing technical debt effectively. The team's responsibilities, operating style, and availability should be transparent to product managers.
Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Watch video: Debugging JS
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured WorkshopFree
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
WorkshopFree
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
Building a Shopify App with React & Node
React Summit Remote Edition 2021React Summit Remote Edition 2021
87 min
Building a Shopify App with React & Node
Top Content
WorkshopFree
Jennifer Gray
Hanna Chen
2 authors
Shopify merchants have a diverse set of needs, and developers have a unique opportunity to meet those needs building apps. Building an app can be tough work but Shopify has created a set of tools and resources to help you build out a seamless app experience as quickly as possible. Get hands on experience building an embedded Shopify app using the Shopify App CLI, Polaris and Shopify App Bridge.We’ll show you how to create an app that accesses information from a development store and can run in your local environment.
React Performance Debugging
React Advanced 2023React Advanced 2023
148 min
React Performance Debugging
Workshop
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)