EDDYMENS

Published 8 months ago

What Is Prerendering?

Whenever you request a webpage you will get one of two things:

a. Everything you need to render the pageb Some markup [↗] structure and Javascript to load up the remaining page structure and content.

Option b relies on Javascript to get the rest of the markup and data needed to render the page properly.

Most Single Page Applications [→] load up this way, and if you should view the source code sent to the browser from the server you will notice it is usually scanty because again the Javascript code will request the required markup [↗] structure and content via HTTP request.

Prerendering is the process of taking an option b type source code and getting an option a source code out of it.

Thus instead of relying on the browser to execute the Javascript code to get everything we need to render the page we use a prerender tool for that purpose.

The output of a prerender tool can be sent to the browser and it will render the full page without further processing similar to option a

Prerender is useful when it comes to SEO. SEO crawlers [↗] render pages and crawl through their content to index them. Some crawlers might not be able to parse the Javascript code found in single page applications which means not being able to get the full content and page structure to perform proper indexing.

For this reason, prerenders are set up as part of the server to serve prerendered SPA content to crawlers and the raw SPA files to browsers.

Here is another article you might like 😊 What Is A Single Page Application (SPA)?