Reader small image

You're reading from  Full Stack Web Development with Remix

Product typeBook
Published inNov 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781801075299
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Andre Landgraf
Andre Landgraf
author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf

Right arrow

Streaming data to the client

There are several different data-fetching strategies. We can initiate data fetching on the client using client-side fetch requests or execute data fetching on the server to take advantage of server-side rendering. We can even fetch data during build time for static site generations. In this section, we will discuss the trade-offs of server-side data fetching and review the requirements of HTTP streaming.

Motivating server-side data fetching and streaming

Remix promotes fetching data on the server using loader functions for each route, as opposed to fetching data at the component level. During the initial page load, the loader functions are called before React renders on the server. This guarantees that the loader data is available for the server-side rendering step, eliminating the need for client-side data-fetching logic and loading states.

When initiating data fetching on the client, we first need to load the HTML document and then wait for the...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Full Stack Web Development with Remix
Published in: Nov 2023Publisher: PacktISBN-13: 9781801075299

Author (1)

author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf