
SSR (Server-Side Rendering) and SSG (Static Site Generation) are two essential rendering strategies that every frontend developer encounters sooner or later. Whether you’re just starting out or have years of experience, understanding these concepts is crucial for building fast, scalable web applications.
In this article, we’ll break down the core ideas behind rendering strategies, dive into the differences between SSR and SSG, and explore how to decide which one fits your project best. We’ll also discuss performance trade-offs, cost considerations, and what’s next in the evolving frontend ecosystem including other rendering approaches gaining traction.
Rendering and rendering strategies
Rendering is the process of executing code to update a page’s structure or content. A rendering strategy defines when and where this rendering happens, on the client, the server, or during the build phase, and directly affects performance, SEO, and user experience.
Grasping these foundational concepts is essential before diving into SSR and SSG, which are just two of several rendering strategies. Without this context, comparing them effectively wouldn’t be possible.
Understanding SSR
Server-Side Rendering (SSR) is a rendering strategy in which a web page is generated on the server in real time when a user requests it. This means that each time a user visits a page, the server processes the request, generates the necessary HTML, and sends it to the browser.
SSR is particularly useful in the following scenarios:
- When the content of a page is dynamic and updated frequently
- When real-time data needs to be reflected immediately
- When search engine optimization (SEO) and social media sharing are important, as server-rendered HTML is easier to index
- When a faster time to first byte (TTFB) is needed, especially compared to client-side rendering (CSR)
However, adopting SSR introduces several considerations:
- It requires a more complex build and deployment setup compared to static or client-side approaches
- It can increase server workload, as each user request results in server-side processing
- Pages may take longer to become interactive, particularly under high load
- It demands more technical knowledge to implement and maintain effectively
- Efficient caching becomes more difficult, as each page may generate unique HTML output
In summary, SSR can offer significant benefits for dynamic, user-facing applications that rely on up-to-date content and SEO. At the same time, it introduces operational complexity and performance trade-offs that must be carefully evaluated based on the specific needs of the project.
How SSR works
Server-Side Rendering (SSR) is a multi-step process that begins with a user request and ends with the fully rendered page displayed in the browser.
The majority of the processing responsibility lies with the server. It handles key tasks such as routing, data fetching, and caching before returning a complete HTML page to the client. While the server manages most of the workload, the client side also plays a role. Particularly in rendering the content received and managing any interactive elements.
The accompanying flow diagram outlines each step in this process and illustrates how responsibilities are distributed between the server and the client.

The SSR dilemma
At some point, most developers will face the question: is Server-Side Rendering (SSR) the right approach for this project? The answer is rarely straightforward and often depends on a range of nuanced factors.
Making this choice requires a thorough understanding of the project requirements, the available tools, and their limitations. Generally, if you are building an e-commerce platform, a social media site, a news web application, an online banking system, or a booking platform, it is widely recommended to seriously consider using SSR.
The next steps
The first step is often the most challenging in any journey, as it opens some paths while potentially closing others. Once the decision to use SSR has been made, developers face the next question: should they build the solution from scratch or select a framework? This section will focus on frameworks.
Contrary to some ecosystems, the JavaScript ecosystem is very dynamic, with new libraries and frameworks being released frequently. Since the start of this article, numerous new JavaScript libraries and frameworks have appeared, rendering some of the discussed content outdated.
Despite this rapid evolution, this article emphasizes fundamental concepts that are unlikely to change frequently but remain essential for developers to understand while staying informed about the latest advancements.
One of the most popular SSR libraries and frameworks is Next.js. It is important to note from the outset that Next.js also supports static rendering, which allows developers to switch strategies without changing libraries.
For those accustomed only to “pure” React, Next.js may feel somewhat opinionated, which could be challenging at first.
This is only an introduction, and using Next.js is not mandatory if it does not suit your needs. There are other options available, such as Gatsby, Nuxt.js, and Gridsome, each offering unique features and benefits related to rendering strategies.
These alternatives will be covered in more detail in other articles. For now, it is important to highlight the diversity of available options.
A look at SSG
Static Site Generation (SSG) is a rendering strategy similar to Server-Side Rendering (SSR).
The key difference is that the page content is generated on the server at build time, rather than upon each user request. This means pages are pre-rendered and ready to be delivered immediately to the client.
Advantages of SSG include:
- Very fast page loads due to pre-rendered content
- Reduced server load and lower hosting costs
- Improved security with fewer attack vectors
- Ideal for use with Content Delivery Networks (CDNs)
- Easier deployment, hosting, and scalability
Limitations of SSG include:
- May require additional solutions to handle dynamic features
- Build times increase as the site grows larger
- Not suitable for applications requiring real-time data
- Content updates require rebuilding the site
- Limited support for dynamic functionality
How SSG works
SSG differs from SSR in that it shifts much of the server workload from runtime to build time. This change simplifies the overall flow conceptually. However, when comparing the SSR and SSG processes, many of the steps remain similar.
Using a diagram to visualize the process can help reinforce our understanding and clearly illustrate the workflow.

The SSG dilemma
Similar to SSR, the general consensus within the developer community is that SSG is typically the preferred choice when the use case involves static data that does not change frequently. This article aims to provide enough information to help you understand both rendering strategies without overwhelming detail, guiding you toward an informed decision.
The next steps
Choosing SSG does not limit future options, as most frameworks support both SSR and SSG. This flexibility means that if project requirements evolve and SSG is no longer appropriate, switching between rendering strategies can be managed without needing to change frameworks.
As noted earlier, frameworks such as Next.js, Gatsby, and Nuxt.js are worth considering.
Hybrid approach
In many projects, selecting exclusively between one rendering strategy or the other may not be practical. In such cases, it is important to recognize that a hybrid approach is available through several frameworks.
Next.js, for example, offers this hybrid capability, enabling developers to leverage both static site generation (SSG) and server-side rendering (SSR). The key consideration remains selecting the appropriate rendering method based on the content needs of each page:
- SSG (getStaticProps): Best suited for static content that changes infrequently, such as blog posts, product catalogs, or marketing pages.
- SSR (getServerSideProps): More appropriate for dynamic content, including user dashboards, real-time updates, or pages requiring authentication.
The vast ecosystem of rendering strategies
Strategies
At the outset, it was noted that Server-Side Rendering (SSR) and Static Site Generation (SSG) are not the only rendering strategies available. Having a broad understanding of these options is what distinguishes a developer from an engineer. While familiarity with the most common methods is essential, it is important to explore the full range of strategies to choose the best approach for each project.
As the saying goes, “if you only have a hammer, everything looks like a nail.” The following rendering strategies, presented in no particular order, represent the diversity of approaches available:
- Client-Side Rendering (CSR): Content is rendered entirely in the browser, with only a minimal HTML shell initially delivered to the client.
- Incremental Static Regeneration (ISR): Combines static generation with server-side updates, allowing pages to be statically generated but updated on demand.
- Progressive Rendering: Content is rendered progressively in chunks to improve perceived performance; techniques such as lazy loading fall under this category.
- Edge-Side Rendering (ESR): Content is pre-rendered or personalized at edge servers geographically close to the user, providing ultra-fast response times.
- Rehydration: The initial page load is static or server-rendered, after which JavaScript activates dynamic content.
- Streaming Server Rendering (SSR Streaming): HTML is streamed incrementally to the client during server rendering, speeding up the time to visible content.
- Static Pre-Rendering (SPR): Pages are pre-rendered and cached upon first load, then served statically on subsequent requests.
- Hybrid Rendering: Different strategies such as SSR, SSG, and CSR are combined based on the specific requirements of individual pages or routes.

Frameworks
Given the breadth of the JavaScript ecosystem, it is useful to highlight some of the most widely adopted frameworks within the development community:
- Gatsby.js: A React-based static site generator (SSG) known for its strong performance and suitability for building static websites with extensive capabilities.
- Nuxt.js: A Vue.js framework that supports both static site generation and server-side rendering, offering a comprehensive set of features for developing modern web applications.
- Remix: A React-based server-side rendering (SSR) framework designed for creating fast, dynamic web applications. Remix emphasizes smooth navigation and efficient data fetching, making it particularly well-suited for applications with complex routing and server-driven data interactions.
- Angular Universal: An extension of Angular that enables server-side pre-rendering of Angular applications, enhancing search engine optimization (SEO) and reducing initial load times.
The costs
An important consideration when evaluating SSR and SSG strategies is the associated cost. For any organization, expenses related to development, hosting, and maintenance contribute significantly to the overall viability of a product in the market.
Simply put, the greater the complexity and resources required to develop a product, the higher its cost.
For instance, implementing SSR typically results in increased server costs, higher maintenance demands, and a need for more experienced developers, which raises technical skill expenses. This does not imply that SSR should be avoided; in many cases, it is essential. However, it is crucial to carefully assess these factors, as an unwise choice can negatively affect both budgets and project outcomes.
Conclusion
This article aimed to explore two key rendering strategies, SSG and SSR, highlighting their advantages and disadvantages, as well as their impact on team dynamics and the overall viability of projects in the market.
The ecosystem provides numerous options within both strategies, and depending on the specific use case, developers may choose to implement a hybrid approach, which is supported by frameworks such as Next.js.
Ultimately, technical knowledge alone does not define a skilled engineer. Equally important is the ability to understand project goals and constraints in order to select the technology that best aligns with the requirements.
Wishing you success in your development efforts.