logo
Parslinks
Back to blog
Platform5 min read

Static site or server rendering? Cost and speed in practice

A marketing site that rebuilds every page on every visit is spending money and speed for nothing.

Ehsan Yaghmori

Founder & CTO, Parslinks

A design agency in Tehran built a marketing site for a dental clinic with Next.js and a CMS: home page, services, the dentists, articles and a booking form. Everything was server-rendered, because "content comes from the CMS and has to be fresh". The site works, but on mobile data the home page takes half a second to send its first byte, and every time the clinic runs an Instagram ad, the small server buckles.

The simple question nobody asked: how many times a day does this site's content change? The answer: a few times a month.

Two approaches, one site

Static generation and server rendering compared for a marketing site

Static (SSG): each page is built once at build time and served as a ready HTML file. The server only hands out files, so it's fast, cheap, and traffic spikes barely register.

Server rendering (SSR): every request runs server code, fetches from the CMS and builds HTML. Always fresh, but response time depends on the CMS and server speed, and capacity is whatever the server can handle.

The numbers

The table's figures come from measuring that same site from Tehran on a fixed-line connection. On mobile data or at busy hours, the gap grows. More important than the exact numbers is the order: a ready file is always faster than building a page.

So when is SSR necessary?

When page content differs per user or must be exact at that moment:

  • User dashboards, the cart, and anything behind login.
  • Live stock and prices (though often only that part needs to be dynamic).
  • Search results with endless filter combinations.

For the About page, the services list and blog articles, SSR is usually just cost.

The middle way: ISR

The agency's fair objection was: "If the clinic adds an article, we don't want to rebuild the whole site for every change." The answer is incremental static regeneration (ISR): pages are built and served statically, and when content changes, only that page is rebuilt in the background.

app/blog/[slug]/page.tsx
// Article page: static, regenerated when the CMS says so
export const revalidate = 3600; // at most an hour stale, even if the webhook never arrives

export async function generateStaticParams() {
  const posts = await cms.listPosts();
  return posts.map((p) => ({ slug: p.slug }));
}

// app/api/revalidate/route.ts — the CMS calls this after publishing
import { revalidateTag } from "next/cache";
export async function POST(req: Request) {
  if (req.headers.get("x-secret") !== process.env.REVALIDATE_SECRET) {
    return new Response(null, { status: 401 });
  }
  revalidateTag("posts");
  return Response.json({ ok: true });
}
ts17 lines

How it ended for the clinic

The agency made the public pages static with ISR and kept only the booking form dynamic. Home-page TTFB dropped from about 450 ms to under 50 ms, the small server stopped buckling under Instagram ads, and the clinic manager still publishes articles in the CMS and sees them live a few seconds later.

The simple rule: build each page with the least dynamism it actually needs.

Frequently asked questions

Join the discussion

No comments yet. Be the first to share your thoughts.