Server Side Rendering

We can use this topic to talk about how we explain Frontity’s Server Side Rendering.

This is the info we have right now in the Github repository:


» How does Frontity work?

Frontity is a React app that lives in Node.js, separated from WordPress.

  • It uses the WP API to retrieve content and generate the final HTML.
  • It is also capable to generate AMP pages with the same React code and CSS.

Why a different Node.js server?

React is a JavaScript library. In order to generate HTML for the visitors or Google, the server needs to be able to run JavaScript as well.

In theory a PHP server can send an empty HTML with the JavaScript files and the visitor will see the page after the JavaScript has loaded, but it is not a good user experience and certainly not recommended if your site needs to rank in Google.

Frontity is prepared to be hosted either in a regular Node.js server or in serverless services like AWS Lambda, Now, Netlify, Google Functions and so on. That makes it super cheap and infinitely scalable.

In the future we will support Static Rendering (like Next.js and Gatsby) but I guess we should not advertise it yet.

This is what we have in the docs right now:


Server Side Rendering

Frontity responds with a fully populated HTML file generated with React . This reduces the time required for the first contentful paint and ensures that the SEO is not harmed .

2 Likes

Hi, is it possible to set up Frontity so that it only works in SSR mode ? ie. make Frontity respond to every request with a fully populated HTML page. For security reasons, we’d like a scenario where only the Frontity/Node server has access to the Wordpress REST APIs.

Many Thanks,
Beemer

Frontity only works in SSR mode (it doesn’t have a static generation mode)