A Saga of Web Rendering Woes

Rate this content
Bookmark

This talk will look at the evolution of web rendering modes and what the Jamstack movement is all about. We will build a demo project to show how a static site generator and a Headless CMS can be combined to create dynamic and engaging stories while maintaining a static site's performance and scalability benefits.

You will learn about the advantages and limitations of each rendering mode and gain a deeper understanding of how to use Jamstack to build powerful and dynamic storytelling experiences.

This talk has been presented at Vue.js London 2023, check out the latest edition of this JavaScript Conference.

FAQ

The main rendering methods discussed include client-side rendering, server-side rendering, static site generation, incremental static regeneration, and edge rendering.

Client-side rendering is when web content is rendered in the browser using JavaScript. Benefits include lower server costs, better in-app user experience, and improved offline support.

Client-side rendering faces challenges such as poor first-time user experience due to large payloads, accessibility issues for users with JavaScript disabled, and initial problems with SEO as search crawlers may not wait for JavaScript to render content.

Server-side rendering improves initial load performance and SEO by rendering HTML on the server before it's sent to the user. It also enhances security by keeping API tokens server-side.

Static site generation involves creating web pages during the build process, which are then cached and served via a CDN. This method offers fast performance, cost efficiency, enhanced security, and scalability.

Incremental static regeneration is a technique where only parts of a site that have changed are regenerated, rather than rebuilding the entire site. This method supports dynamic data and offers faster rebuild times.

Edge rendering processes web content at the edge of the network, closer to users, which reduces latency and improves loading times. It's suitable for dynamic and real-time content.

Hybrid rendering allows different rendering methods to be used for different parts of a website, such as static generation for some pages and server-side rendering for others. This flexible approach optimizes performance and user experience.

Jamstack architecture decouples the frontend from the backend, using JavaScript, APIs, and Markup to build fast, secure, and scalable websites. This architecture allows for flexibility in choosing technologies for both the frontend and backend.

In a Jamstack setup, static sites are generated using a static site generator, leveraging APIs for dynamic data and serving content through a CDN for high performance and security.

Alba Silvente Fuentes
Alba Silvente Fuentes
28 min
12 May, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk discusses the problems faced in building and rendering web applications, different rendering methods and strategies, and the benefits of the Yamstack architecture. It covers server-side rendering, static site generation, incremental static regeneration, and edge rendering. The speaker demonstrates how to build a static site using a Hello CMS and the JAMstack architecture. Other topics include connecting Storyboard with a Nuxt application, mock data, hybrid rendering, and handling I18N with a static site generator.

1. Introduction to Rendering Methods and Strategies

Short description:

In this talk, I will discuss the problems we face while building and rendering web applications, the different rendering methods and strategies used, and the benefits of the Yamstack architecture. I will also demonstrate how to build a static site with a Hello CMS in just two minutes. The history of rendering methods begins with hosting static files and gradually incorporating servers and back-end technologies. Frameworks like Vue, React, Asphalt, and Angular introduced client-side rendering, where the website is rendered in the user's browser using JavaScript. This approach offers cost savings, improved user experience, and better offline support. However, it has drawbacks such as poor first-time experience, accessibility issues, and challenges with search engine optimization. Despite these challenges, search crawlers can now render JavaScript-based sites.

So, hi, everyone. I'm so glad to be here and I hope that you enjoyed the talk that I will give today. My main goal of today is to tell you all the problems that we face while building sites, while rendering our web applications, that we end up having a bunch of web rendering methods to use nowadays, and I will show you the history behind them.

So, the main thing I want you to go home and take from this talk is an overview of the rendering methods and strategies that we use nowadays to render over JavaScript applications, understanding what is the Yamstack architecture about and the benefits that come with it. And learn how to build a static site with a Hello CMS in just two minutes.

So, this history can start with another main character than the website. We have been building websites for a long time, almost my age, and we have been starting just hosting some static files in the cloud, and after some time, we'll start creating servers with PHP or any other back end technologies, and we'll start combining them to have a better application with more data on it and not just a static file. But the developers of the JavaScript ecosystem started deciding that maybe we want to have more interactive applications that will help the end user to interact something with, like a form, or maybe something that is more fancier. So that's when frameworks like Vue, React, or Asphalt, or Angular started creating new methods. And this one was client side rendering.

So basically the website is now rendered in the browser, basically in the device of the end user, what we call the client, using JavaScript. So when a user enters on your site, it will download a skeleton HTML, that it provides a URL to a script, a payload that they will download and execute to render your application. So basically now you have a process that will render the application inside the laptop of your user. The benefits of using this method are quite obvious, it's cheaper because we don't have any server, everything is done in the client via JavaScript. We have better in application users' experience, because now when they navigate they already have everything from the first load. And when they navigate between pages, they will just see some loadings and we will retrieve some data from the APIs. So that's how we work. And then we will have better offline support, if we catch everything on the browser of the user, because we don't have any API calls, imagine you just have an application with some things, then they will have everything without the Internet connection.

But what happened? Of course, every rendering method that we will see will have some drawbacks. The first one was the poor first time experience. So when you download the website the first time, if you don't have code splitting and you have everything in one big payload, it will take too much to load just one page. It was not optimal for a long term usability. So the other point that we faced was accessibility. If some people were JavaScript disabled from the browser because some people are doing that, it sounds weird nowadays but there is a lot of people trying to navigate without JavaScript. So this was not a rendering method if our users will not have JavaScript enabled. But the real problem in this history was the villain, the search engine optimization, the SEO. Basically the search crawlers when the clients are rendering up here, they don't have the proper time to wait for the JavaScript to render your site. So in the first interaction they didn't see any content there. So that was a problem. And, of course, nowadays they changed it and now they can render our site in the search crawlers.

2. Server-Side Rendering and Static Site Generation

Short description:

Server-side rendering allows for prepopulated HTML to be sent to the user, improving performance, CEO, and security. However, slow connections and increased server load can be challenges. Static site generation solves these issues by generating pages during build time and caching them in a CDN.

But what happened? They will not wait forever. So if your performance is not okay, they will not wait for your page to be rendered and that will not be indexed in the search engines. So what was the solution to this? Our next hero, the server-side rendering.

Server-side rendering started with NAX, NAX, and all these meta-frameworks that are on top of the frameworks we use. And basically it's rendering the HTML of our webpage on the server before sending it to the end user. So now when we download a page from entering in a URL, we will download the HTML prepopulated in the beginning. And what these frameworks does is just create a universal app that will, in the background, also download the JavaScript with executing it that will re-rotate your page while you are navigating.

So you are getting the benefits from client-side rendering, but the first load will be really performant. And that's one of the benefits. We improve the performance in the initial load because we basically have the prepopulated HTML. We have better CEO because now search engines don't need to wait a lot for the page to load because it's just the first page. And then, we improve security because everything that we need to call to the APIs, the API tokens will be in the server, so you don't need to have in your API, in your client, the API tokens. That's really cool.

But what happens with this? Of course, if we were using server-side in the old times, we didn't have the interactivity that we have nowadays with the universal app that Next and Next provide. But nowadays, it's not a problem anymore. The problem is that we have bad and slow connections. So basically, if you are in Nigeria and your data server is in America, you will have, really, a bad metric for the time to first byte, the Core Web Vital. So basically, it will take still much to load for some people, so that's not good. But the real villain here was the increased server load. Now, it demands more performance from the servers to generate the HTML because they are the ones in charge of that. And the number of server was way higher because now each time a user enters on your site for the first time, they will call the server, and that means money for the business. So if you don't have a website that has real data or maybe something that is really changing over time, maybe you don't want this solution because it's not made for your site. Imagine a publisher or a newspaper. Maybe they just have a static content. That's where the Nest Hero came.

So basically, now we have a static site generation. A static site generator generates pages during build time. So when we develop our code and we push it to our cloud, basically, we run a process that will generate the page and that page will be cached and saved in the CDN. The CDN is a content delivery network that is close to your end user. It has multiple nodes across the world.

QnA

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 Conference 2022React Advanced Conference 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.
Optimizing HTML5 Games: 10 Years of Learnings
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Optimizing HTML5 Games: 10 Years of Learnings
Top Content
PlayCanvas is an open-source game engine used by game developers worldwide. Optimization is crucial for HTML5 games, focusing on load times and frame rate. Texture and mesh optimization can significantly reduce download sizes. GLTF and GLB formats offer smaller file sizes and faster parsing times. Compressing game resources and using efficient file formats can improve load times. Framerate optimization and resolution scaling are important for better performance. Managing draw calls and using batching techniques can optimize performance. Browser DevTools, such as Chrome and Firefox, are useful for debugging and profiling. Detecting device performance and optimizing based on specific devices can improve game performance. Apple is making progress with WebGPU implementation. HTML5 games can be shipped to the App Store using Cordova.
RedwoodJS: The Full-Stack React App Framework of Your Dreams
React Summit Remote Edition 2021React Summit Remote Edition 2021
43 min
RedwoodJS: The Full-Stack React App Framework of Your Dreams
Top Content
Redwood JS is a full stack React app framework that simplifies development and testing. It uses a directory structure to organize code and provides easy data fetching with cells. Redwood eliminates boilerplate and integrates Jest and Storybook. It supports pre-rendering and provides solutions for authentication and deployment. Redwood is a cross-client framework that allows for building web and mobile applications without duplicating work.

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 🤐)
React at Scale with Nx
React Summit 2023React Summit 2023
145 min
React at Scale with Nx
Top Content
Featured WorkshopFree
Isaac Mann
Isaac Mann
We're going to be using Nx and some its plugins to accelerate the development of this app.
Some of the things you'll learn:- Generating a pristine Nx workspace- Generating frontend React apps and backend APIs inside your workspace, with pre-configured proxies- Creating shared libs for re-using code- Generating new routed components with all the routes pre-configured by Nx and ready to go- How to organize code in a monorepo- Easily move libs around your folder structure- Creating Storybook stories and e2e Cypress tests for your components
Table of contents: - Lab 1 - Generate an empty workspace- Lab 2 - Generate a React app- Lab 3 - Executors- Lab 3.1 - Migrations- Lab 4 - Generate a component lib- Lab 5 - Generate a utility lib- Lab 6 - Generate a route lib- Lab 7 - Add an Express API- Lab 8 - Displaying a full game in the routed game-detail component- Lab 9 - Generate a type lib that the API and frontend can share- Lab 10 - Generate Storybook stories for the shared ui component- Lab 11 - E2E test the shared component
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.
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
React Performance Debugging
React Advanced Conference 2023React Advanced Conference 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 🤐)
Hard GraphQL Problems at Shopify
GraphQL Galaxy 2021GraphQL Galaxy 2021
164 min
Hard GraphQL Problems at Shopify
WorkshopFree
Rebecca Friedman
Jonathan Baker
Alex Ackerman
Théo Ben Hassen
 Greg MacWilliam
5 authors
At Shopify scale, we solve some pretty hard problems. In this workshop, five different speakers will outline some of the challenges we’ve faced, and how we’ve overcome them.

Table of contents:
1 - The infamous "N+1" problem: Jonathan Baker - Let's talk about what it is, why it is a problem, and how Shopify handles it at scale across several GraphQL APIs.
2 - Contextualizing GraphQL APIs: Alex Ackerman - How and why we decided to use directives. I’ll share what directives are, which directives are available out of the box, and how to create custom directives.
3 - Faster GraphQL queries for mobile clients: Theo Ben Hassen - As your mobile app grows, so will your GraphQL queries. In this talk, I will go over diverse strategies to make your queries faster and more effective.
4 - Building tomorrow’s product today: Greg MacWilliam - How Shopify adopts future features in today’s code.
5 - Managing large APIs effectively: Rebecca Friedman - We have thousands of developers at Shopify. Let’s take a look at how we’re ensuring the quality and consistency of our GraphQL APIs with so many contributors.