Search⌘ K
AI Features

Server-Side Rendering (SSR)

Explore how server side rendering (SSR) works in Next.js, including its benefits like improved SEO and security, and its impact on performance and user experience. Understand when to use SSR and how to implement it using getServerSideProps for dynamic content.

Even though server-side rendering (SSR) sounds like a new term in the developer’s vocabulary, it’s actually the most common way of serving web pages. If we think of languages such as PHP, Ruby, or Python, they all render the HTML on the server before sending it to the browser, which will make the markup dynamic once all the JavaScript content has been loaded.

Well, Next.js does the same thing by dynamically rendering an HTML page on the server for each request, then sending it to the web browser. The framework will also inject its scripts to make the server-side rendered pages dynamic in a process called hydrationHydration is a process in which client-side JavaScript converts a static HTML web page into a dynamic web page..

Imagine we’re building a blog and want to display all the articles written by a specific ...