Advanced Site Rendering Patterns on the Jamstack

Rate this content
Bookmark

In this session, I'll go over these patterns (Sharding, ISR, DPR, DSG) and show our viewers and 2million+ other Jamstack developers how to leverage them to build large sites without the overhead on lengthy build times.

FAQ

JAMstack is a modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup. It improves website performance by pre-rendering pages during the build process, ensuring that users receive content instantly without server-side processing delays, leading to faster load times and a better user experience.

The benefits of using JAMstack include faster site loading times, improved security due to reduced server-side dependencies, better SEO as content is pre-rendered and readily available to search engines, and simplified scaling by serving static content from a CDN.

Large JAMstack sites can face long build times due to the need to pre-generate numerous pages. Solutions to this include incremental builds, which rebuild only changed pages, and splitting a large site into microsites to manage builds more efficiently. Additionally, techniques like Incremental Static Regeneration (ISR) can generate pages on-demand rather than at build time.

ISR is a technique used in JAMstack to optimize build times. It allows developers to regenerate only the new or updated pages instead of rebuilding the entire site. This significantly reduces build times and improves site update efficiency by focusing on changed content only.

JAMstack handles dynamic content and user interactions through APIs and serverless functions. While static content is prebuilt and served directly from a CDN, dynamic interactions are managed by fetching data from APIs or executing serverless functions, allowing for real-time user experiences without compromising performance.

While JAMstack offers several advantages, there are trade-offs such as the complexity of managing large builds, potential stale content due to caching strategies, and the need for developers to adapt to a predominantly static site architecture. Additionally, some advanced dynamic functionalities might require more complex setups involving serverless functions and APIs.

Ekene Eze
Ekene Eze
23 min
21 Oct, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Today's Talk discusses advanced site rendering patterns in the JAMstack, including the benefits and challenges of using this approach. It explores solutions like incremental builds, microsites, and incremental static regeneration to improve build times and performance. The Talk also introduces distributed persistent rendering and Gatsby v4 as new solutions to enhance static site generation and server-side rendering.

1. Introduction to JAMstack Rendering Patterns

Short description:

Hello. Today I'll be talking about advanced site rendering patterns in the JAMstack. You will learn how rendering works, the pros and cons of rendering patterns, and how to improve performance. Building the JAMstack way solves the problem of slow loading times by processing requests at build time. However, there are trade-offs to consider.

Hello. Thank you very much for the introduction. Of course, my name is Ekene Eze, and today I'll be talking about advanced site rendering patterns in the JAMstack. Well, I'll get to my introduction just in a minute. Yes, so I work as a developer experience engineer at Netlify and I have a YouTube channel where I make video tutorials about web development. If you want to follow me on socials, I'm on Twitter, at Ekene underscore IO. Let's jump into it.

Okay, we're not jumping into it quite yet because I'd like to also tell you that outside being a developer experience engineer and doing my thing on YouTube and learning JavaScript and doing work with it, what I really want to do is be a mixologist so that I can get all my friends drunk for no reason at all. That's probably a story for a different But eventually, I will get to tell the story. And I hope you all are here to hear it when that happens. But I will go on and get started for today.

So what you will learn today is how rendering works on the jumpstack. If you've been building jumpstack applications with Knox or with any other framework, in your static sites generator, you will better understand how rendering works. You will also understand the pros and cons of some of the rendering patterns we have, what they bring to the table and what trade offs they also bring. Finally, you will also learn what to do when your jumpstack site is performing poorly. For instance, if it's taking like too long to build, you'll understand why that is happening and the things you can do to help speed up that process. But before we dive into it, let's take a trip back memory lane to understand why this is even important in the first place.

All right. So before now, what happens is when a user comes to your site and requests for products. And in this case, I mean, what I mean is if a user comes to your website and they click on products, ideally what happens is a request goes off to your server and depending on your server architecture and how it's configured. This request could go through your load balancers, your web servers, your application servers, and databases and all of that thing that goes on behind the scenes to serve that request. So ideally, this goes out, your server processes the request, produces the right contents, and sends it back to the user. While all that is going on behind the scenes, of course your user will be seeing either a blank screen or a loading screen or a spinner, depending on how you build your site. So this is not very good for the developer and not also very good for the user who is using the application because they get to stay at a blank screen or a loading screen for a while before the actual contents get served. But building the JAMstack way kind of like helps us solve that problem, and it solves it this way, right? All of that processing happens before the site goes live. So for instance, if you've built your JAMstack application, once you run the build command, what happens is the static site generator goes off and makes all the requests on your behalf, right? And generates all the pages, generates all the dynamic routes and all the parts that will be available in your application. And then the content is now served to your users. So what happens now is instead of users coming to your site and clicking buttons to make requests, all of those requests happens at build time so that when your users come to the site, all the contents they need are readily available. So there's no lags, there's no waiting time, there's no loading spin-outs going on forever. So this is a good way, but as you can imagine, like every solution, like everywhere that technology comes with a solution, they also have some trade-offs.

2. Benefits of JAMstack

Short description:

The benefits of using the JAMstack way include faster site speed, improved user experience, better SEO, and enhanced security through CDN deployment. Developers can focus on their core skill sets without worrying about infrastructure.

But before we talk about the trade-offs, the benefits we get from using the JAMstack way is that your site is faster and your users are happy. I mean, right? If you don't ever have to wait on loading screens to fetch content, or if you're visiting a site and you're seeing that it's fast, if you click a button, everything happens as it should without any lags, your users will be happy. As a user, I would be happy, right? And then you also get better SEO out of the box as the developer or as the owner of the site, all your sites is being, all the content of your site is readily available. So Google and all the search engines will be happy. They can crawl and index your site properly because all the contents is available ahead of time. And also deploying on the CDN means you have limited point of attack. So it's more secure because you only have to worry about your site and the CDN. You don't have to worry about securing your databases, your load balancers, your web servers, and all of those things, you just have to care about your own application and then the CDN does the rest for you. Building this way also enables developers to stay within their core skill sets. I mean, I see myself as a front end developer. I like building with Vue.js and Nox.js. I don't ever want to have to worry about how load balancers or containers or Docker works, right? And building this way kind of like helps me just stay within my skill set and not worry about those things that I'm not comfortable with by default.

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

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
Tired of rebuilding your React-based web framework from scratch for every new project? You're in luck! RedwoodJS is a full-stack web application framework (think Rails but for JS/TS devs) based on React, Apollo GraphQL, and Prisma 2. We do the heavy integration work so you don't have to. We also beautifully integrate Jest and Storybook, and offer built-in solutions for declarative data fetching, authentication, pre-rendering, logging, a11y, and tons more. Deploy to Netlify, Vercel, or go oldschool on AWS or bare metal. In this talk you'll learn about the RedwoodJS architecture, see core features in action, and walk away with a sense of wonder and awe in your heart.
A Saga of Web Rendering Woes
Vue.js London 2023Vue.js London 2023
28 min
A Saga of Web Rendering Woes
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.
How do Localise and Personalize Content with Sanity.io and Next.js
React Advanced Conference 2021React Advanced Conference 2021
8 min
How do Localise and Personalize Content with Sanity.io and Next.js
Structuring your content with Sanity.io means you can query content based on signals from your visitors, such as their location. Personalisation is a tricky problem with static sites and the jamstack, this demo will show you how it can be done with Sanity.io, Next.js, and Vercel.
Keeping It Simple
React Summit Remote Edition 2021React Summit Remote Edition 2021
9 min
Keeping It Simple
Netlify CEO and co-founder Matt Biilmann reflects on the history of React, the promises of the Jamstack, and the complexity that can creep into developer workflows if we don't continue to defend simplicity over time. In this lightning talk, Matt describes the trade-offs developers face to deliver large sites and introduces a new idea for a more scalable future solution.
API-first Development with Headless WordPress
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
API-first Development with Headless WordPress
When the burden of rendering is removed from WordPress, it becomes an open source API platform. With a few plugins like WPGraphQL, you can create an extensible backend for your React apps to consume which enables modern architectures and development practices in WordPress.
Incremental Static Regeneration: Static Sites on Steroids
React Advanced Conference 2021React Advanced Conference 2021
22 min
Incremental Static Regeneration: Static Sites on Steroids
Static sites are great. They are fast, cheap, secure, and easy to maintain. But generating static assets is a process that takes more and more time while our site gets bigger. We will talk about ISR, a feature that Next.js framework offers us to generate static pages at runtime.

Workshops on related topic

Crash Course into the Jamstack with Next.js & Storyblok
React Day Berlin 2022React Day Berlin 2022
161 min
Crash Course into the Jamstack with Next.js & Storyblok
WorkshopFree
Arisa Fukuzaki
Chakit Arora
2 authors
You might have read already about Jamstack. You probably already used Next.js, and recently you may be hearing a lot about the headless CMSs. This quick course will put all the pieces together and show you why Storyblok, combined with Next.js, is the best combo for your next project. Stop by and try it yourself!
- In-depth Jamstack knowledge. How it changed from old times to the modern world. Learn how Jamstack was created by comparing Static Sites and Dynamic Sites.- How Next.js serves content, and how content is served with Static Site Generation (SSG).- Atomic design methodology, and how this is applied to the content management system.- Hands-on project experience by building a Jamstack project with Next.js and Storyblok.
Prerequisites- Any Text . Visual Studio Code recommended- Node.js LTS- NPM or Yarn- GitHub account- Vercel account- Familiarity with JavaScript, React, and Git. Having worked with Next.js before is a plus
What's included1. Introduction and overview of the workshop2. Introduction to Jamstack3. Introduction to Atomic Design4. Overview of Headless CMS5. Introduction to Storyblok6. Next.js app creation7. Storyblok space creation8. Next.js and Storyblok connection9. Custom components creation10.First-page creation11. Introduction to Visual 12. Dynamic pages addition13. Blog section creation14. Deployment on Vercel
E-commerce on the Jamstack with NextJS and Netlify
React Summit Remote Edition 2021React Summit Remote Edition 2021
120 min
E-commerce on the Jamstack with NextJS and Netlify
Workshop
Nick DeJesus
Nick DeJesus
Jamstack frameworks are changing the way we build top-of-the-line experiences on the web. They are performant, secure and enable developers to build web apps faster than before. In this workshop, Nick DeJesus will walk you through what it's like to build an e-commerce site using NextJS, use-shopping-cart and theme-ui. You will learn how serverless functions with Netlify to help you make secure transactions and how to build accessible UI components that extend use-shopping-cart's abilities.
Jamstack eCommerce 101
JSNation Live 2021JSNation Live 2021
199 min
Jamstack eCommerce 101
Workshop
Bolaji Ayodeji
Bolaji Ayodeji
Digital commerce has changed, and there is an increasing demand for faster and kite efficient solutions. In this workshop, you'll learn about the evolution of ecommerce and how Jamstack and headless commerce evolves shopping experiences on the web. We will explore the basics of headless commerce building a minimal Jamstack ecommerce product page with static content, HTML5, CSS, and Javascript. Finally, we will integrate Commerce Layer for headless commerce capabilities and deploy our application to Netlify.