Chapter 5. Rendering
In Chapter 4, we explored how HTTP shapes communication between client and server. We learned about request-response cycles, streaming, and the fundamental unreliability of the network. Now that we know how we communicate, we can focus on sending the right data to the right place to show users something presentable.
Whenever users view a website, they see the rendered version of the HTML we prepare. In frontend jargon, rendering also refers to the process of generating the HTML we ultimately want to display. To create this HTML, we have several options that can happen on either end of the network communication: client or server.
The exciting part is that none of these techniques are mutually exclusive. You can start on one side and continue on the other. Depending on the use case, a good mix might even be the perfect solution.
In this chapter, we’ll explore the possibilities of rendering. We’ll explore the three fundamental rendering models, examine the patterns modern frameworks have developed to combine them, and build a framework for choosing the right approach for your specific constraints. We will learn the following:
-
The three rendering models: server side, client side, and static generation, along with their trade-offs
-
Modern rendering patterns like hydration, islands architecture, and streaming SSR
-
How to choose the right rendering strategy based on your content, users, and infrastructure
-
How rendering decisions interact with caching and CDN ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access