SSR vs SSG: when to generate a page on the server or at build time
Published on 2026-10-20 by frfrand
SSR vs SSG: how they differ, how they affect performance, SEO, and caching, and when it makes sense to generate a page on the server or when building the site.

Short answer: SSR (server-side rendering) generates a page's HTML every time someone requests it; SSG (static site generation) generates it once, when building the site. SSG is suitable for content that changes little, such as articles or documentation; SSR, for customized pages or with data that changes at every moment. Many sites combine both.
Both strategies can deliver HTML to the browser, but they differ in when that HTML is prepared and how it is updated.
If you are creating a website with Next.js or another modern framework, this choice affects speed, server costs, dynamic content, and maintenance.
The difference with a restaurant menu
Think about printing the restaurant menu every time a customer sits down, with the dishes available at that moment. That is similar to SSR: the server prepares the response when a request arrives.
Now imagine printing a hundred menus at the beginning of the day and handing them out when someone asks for one. That is similar to SSG: the HTML is generated beforehand, during the site's build or publication.
The second option can be very fast, but you have to decide when to regenerate the menus if prices change.
What happens with SSR?
The browser requests a page; the server obtains the data it needs and generates HTML for that request. It can include updated or customized information, depending on the architecture.
But every request can involve additional work. A slow database query can delay the response. Caching can also be added where it is safe, without delivering private information to another person.
SSR does not mean that all JavaScript disappears: a page may need client-side code for interactivity.
And with SSG?
The system builds the HTML before visitors arrive. It is especially useful for documentation, informational pages, articles, or catalogs where content changes in a controlled manner.
That HTML can be served from files or a CDN with little server logic per visit. If the content changes, it may be necessary to rebuild or invalidate a stored version.
Not all platforms generate static pages exactly the same way; some allow incremental regeneration strategies.
Which one ranks better on Google?
There is no rule that says "SSR wins" or "SSG wins". Both can deliver correctly indexable HTML. What matters is the actual content, links, metadata, accessibility, stability, and perceived performance.
If a page has excellent content and a clear structure, the rendering strategy is an implementation decision, not a ranking guarantee.
It is also advisable to avoid generating hundreds of empty or duplicate URLs just to increase the number of indexable pages.
An example with a tours website
The description of a tour of Copenhagen could be generated statically. Photographs, itinerary and frequently asked questions change little.
But seat availability for tomorrow depends on recent bookings. That part can query a backend or use a well-designed dynamic strategy.
A real application can combine strategies instead of choosing just one for the entire domain.
Is SSR the same as SPA?
No. SPA describes an application navigation and interaction pattern; SSR and SSG describe how HTML is obtained or generated. Many frameworks combine server-side rendering, static content and browser interactivity.
A site can deliver HTML from the server and then hydrate interactive components. Knowing these concepts avoids discussions where each person compares things from different categories.
Mistakes worth avoiding
Creating private content as public static HTML. A customized page requires appropriate cache and access policies.
Querying dynamic data unnecessarily on every visit. If an article changes once a month, recalculating everything can waste resources.
Measuring only the first load. Subsequent navigation and real-user metrics matter.
Where does ArduMaker fit in?
In a GitHub deployment on ArduMaker, the deployment configuration covers both cases. A statically generated site is declared as static content: the build leaves a folder and nginx serves it, with the option to redirect everything to index.html in an SPA, without any running process. An SSR server, such as Next.js, is declared as a web service with its port, which the platform writes as a systemd unit and restarts on every deployment. The hosting platform does not replace the decision of how to render each route.
In one sentence: SSR prepares HTML when handling the request; SSG prepares it in advance. The choice depends on changes, customization, and generation cost.
Frequently asked questions
What is ISR? Incremental static regeneration: pages generated as SSG that the framework rebuilds every so often or when requested, without rebuilding the entire site. It is a feature of frameworks like Next.js and requires a running server.
For a blog, is SSR or SSG better? Usually SSG: articles change little and are served quickly from files. Dynamic content, such as comments or searches, can be handled separately.
Does an SSG site need a server? It needs something to serve files, such as nginx or a CDN, but not an application process per visit.
Sources: Web rendering on web.dev · Rendering in Next.js.
