Static Generation vs Server Rendering vs ISR in Next.js
A portfolio page displaying a developer's projects does not need the same rendering strategy as an account dashboard displaying a user's latest activity. Both can use Next.js, React Server Components, and the same database, yet their performance, freshness, and infrastructure requirements can differ substantially. The central question is not simply how quickly a page renders. It is when the page should be generated, how long its output can be reused, and what should trigger an update. Next.js supports several approaches to rendering pages. Static Site Generation (SSG) produces pages ahead of time. Server-Side Rendering (SSR) generates HTML in response to requests. Incremental Static Regeneration (ISR) allows statically generated pages to be refreshed without rebuilding the entire application. Each approach solves a different problem. Choosing incorrectly can introduce unnecessary server work, stale content, expensive database queries, or more complicated cache invalidation than…
// TABLE OF CONTENTS+
Static Generation vs Server Rendering vs Incremental Static Regeneration in Next.js
A portfolio page displaying a developer's projects does not need the same rendering strategy as an account dashboard displaying a user's latest activity. Both can use Next.js, React Server Components, and the same database, yet their performance, freshness, and infrastructure requirements can differ substantially. The central question is not simply how quickly a page renders. It is when the page should be generated, how long its output can be reused, and what should trigger an update. Next.js supports several approaches to rendering pages. Static Site Generation (SSG) produces pages ahead of time. Server-Side Rendering (SSR) generates HTML in response to requests. Incremental Static Regeneration (ISR) allows statically generated pages to be refreshed without rebuilding the entire application. Each approach solves a different problem. Choosing incorrectly can introduce unnecessary server work, stale content, expensive database queries, or more complicated cache invalidation than the application requires. This article compares these approaches through a practical portfolio and CMS scenario, explains their relationship with caching, and demonstrates how to select a strategy based on actual requirements.
1. Understand How Next.js Renders a Page
Rendering is the process of turning application components and their data into output that a browser can display. In a Next.js application, that output can include HTML, React Server Component (RSC) payloads, and references to JavaScript needed for client-side interactions. Consider a blog article at /blog/database-indexes. Before the visitor sees the article, the application needs its title, content, metadata, and potentially related posts. Those values might come from a database, a CMS API, or files stored in the project. Next.js must obtain the required data, render the appropriate components, and deliver the result. The timing of that work determines whether the application can reuse an existing rendered page or must perform rendering during the incoming request. Static generation performs eligible rendering ahead of time. Dynamic rendering performs request-dependent work when a request arrives. ISR adds a regeneration mechanism to statically rendered output. These strategies do not determine every aspect of the user experience. Browser caching, CDN behavior, client-side navigation, JavaScript execution, database performance, and network latency also affect the final result.
2. Static Site Generation (SSG)
What is static generation?
Static Site Generation creates a page before an individual visitor requests it. In a traditional build-time workflow, Next.js retrieves the necessary data, renders the page, and stores its output for subsequent requests. Suppose a developer has published twenty project descriptions. The application can retrieve those descriptions during the build and generate routes such as /projects/virtual-machine and /projects/task-manager. When visitors request these routes, the deployment can serve the already-generated output instead of repeating the complete rendering process. This reduces repeated server-side work. It can also allow static assets to be distributed through a CDN, bringing content closer to users geographically. Static generation is especially useful when many visitors should see substantially the same page and the underlying content changes infrequently. However, static does not mean that the page contains no JavaScript, uses no server anywhere in the deployment, or can never change. It describes how the page output is generated and reused. A statically generated page can include interactive client components, and its output can later be rebuilt or revalidated.
Implementing static generation in the App Router
The following example uses a database-backed project repository. It illustrates the intended data flow; the repository function and database connection must exist in the application.
// app/projects/[slug]/page.tsx
import { getProject, getProjectSlugs } from "@/lib/projects";
import { notFound } from "next/navigation";
export async function generateStaticParams() {
const slugs = await getProjectSlugs();
return slugs.map((slug) => ({ slug }));
}
export default async function ProjectPage({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
const project = await getProject(slug);
if (!project) {
notFound();
}
return (
<main>
<h1>{project.title}</h1>
<p>{project.description}</p>
</main>
);
}generateStaticParams() supplies the known route parameters during build-time generation. Next.js can then prerender those project routes, provided the rest of the route's rendering configuration and data dependencies permit static rendering. The example assumes the application uses a Next.js version with the App Router parameter signature shown above. Check the documentation for the version installed in your project before copying it directly. There is another important detail: generateStaticParams() does not automatically guarantee that every possible slug is available. It returns the slugs the application knows about when generating routes. How unknown paths behave depends on the route's configuration and the framework's rendering behavior. Static generation therefore works particularly well for a portfolio with a known collection of projects. If a new project is added, however, a build-time-only strategy may require a redeployment or a different regeneration mechanism before its page becomes available.
Advantages and limitations of SSG
- Fast delivery: The rendered output can be served without repeating the page's server-side rendering work for each visitor.
- Lower repeated compute: A high-traffic page does not need to repeat the same rendering and database operations on every request.
- CDN compatibility: Static output is well suited to distribution through compatible content-delivery infrastructure.
- Predictable output: Identical published content produces consistent output until a new version is generated.
- Build-time dependency: The build may need access to the CMS or database to retrieve content.
- Content update challenge: Without regeneration or redeployment, a newly published or edited page may not appear in the generated output.
Build time is another trade-off. If a website has a handful of project pages, generating them all during deployment is straightforward. If it has hundreds of thousands of content routes, generating every page on every deployment can become expensive or slow. That does not mean SSG stops being useful for large sites. It means route generation, incremental regeneration, and the choice of which pages to prebuild become increasingly important. Use SSG when the data can reasonably be prepared ahead of time and when the operational cost of updating that output is acceptable.
3. Server-Side Rendering (SSR)
What is server-side rendering?
Server-Side Rendering generates the page on the server in response to an incoming request. Instead of relying exclusively on a previously generated HTML document, the application performs the request-dependent work needed to produce the response. Imagine a dashboard showing the authenticated user's current projects, notification count, and recent activity. Those values can change independently for each user. Rendering the entire dashboard as one shared public page would risk showing the wrong data or exposing private information. With SSR, the application can identify the request context, verify the user's access, retrieve the necessary data, and render an appropriate response. SSR is not inherently slow. A well-designed server-rendered route with efficient queries and adequate infrastructure can respond quickly. The trade-off is that request-time work consumes resources and introduces latency whenever the relevant output cannot be reused safely. SSR also does not mean every database query must be executed afresh. Data-level caching may still be appropriate for shared information, while personalized or sensitive information needs a separate, carefully designed caching policy.
Implementing request-time rendering
// app/dashboard/page.tsx
import { cookies } from "next/headers";
import { getDashboardForSession } from "@/lib/dashboard";
export default async function DashboardPage() {
const cookieStore = await cookies();
const sessionId = cookieStore.get("session")?.value;
if (!sessionId) {
return <main>Please sign in to view your dashboard.</main>;
}
const dashboard = await getDashboardForSession(sessionId);
return (
<main>
<h1>Your dashboard</h1>
<p>Active projects: {dashboard.activeProjects}</p>
</main>
);
}This example reads a request cookie to determine which session is relevant. In the conventional App Router caching model, reading request-specific data such as cookies can make a route dynamically rendered. Current Next.js releases also support newer caching configurations, so the exact behavior should be verified against the project's version and configuration. The example intentionally omits a complete authentication implementation. A production application must validate the session, check expiration and authorization, and ensure that a user cannot retrieve another user's data by changing a session identifier. Also note that returning a message for an absent cookie is not the same as implementing a protected dashboard. Applications commonly redirect unauthenticated visitors to a sign-in route and enforce access checks at the appropriate server-side boundaries. The important principle is that rendering can depend on the incoming request when the output genuinely varies by user, session, or other request-specific input.
Advantages and limitations of SSR
- Request-specific output: The application can render information based on a validated session, request parameters, or current server-side data.
- Potentially fresher data: The route can retrieve current information during the request, depending on its data-fetching and caching configuration.
- Server control: Authentication, authorization, and data assembly can take place on the server.
- Request-time cost: Rendering and uncached data retrieval consume resources when requests arrive.
- Latency dependencies: Slow databases, upstream APIs, or overloaded servers can delay responses.
- Caching complexity: Shared output may be cacheable, but personalized responses require careful isolation to prevent data leaks.
SSR is the appropriate choice when the HTML response must depend on request-time information and cannot safely be reused as a common page. It is not automatically the best choice merely because a website uses a database. A project description can come from PostgreSQL and still be rendered statically. The key question is whether that description needs to be recomputed for each request, not whether its original source is a database.
4. Incremental Static Regeneration (ISR)
The middle ground between rebuilding and rendering every request
Incremental Static Regeneration lets Next.js refresh eligible statically rendered pages without requiring a complete application rebuild for every content change. Consider a CMS-driven blog. An article's title, body, and metadata may change a few times per month, while hundreds or thousands of readers visit it every day. Rebuilding the entire website after each edit is unnecessary. Rendering the article from scratch for every visitor is also unnecessary if most visitors can share the same published version. ISR allows the application to retain generated output and establish a revalidation policy. Depending on the chosen mechanism, a page can become eligible for regeneration after a time interval or be invalidated when an editor publishes an update. This approach combines reusable rendered output with a controlled refresh process. It is particularly useful for product catalogues, documentation sites, blogs, portfolios, and other content-heavy websites where freshness matters but every request does not need a completely new render. ISR does not promise that all visitors will always receive the latest database value immediately. Time-based revalidation is a freshness policy, not a guarantee of immediate synchronization. If a strict freshness requirement exists, the invalidation and serving behavior must be designed around that requirement.
Implementing time-based ISR
// app/blog/page.tsx
import { getPublishedPosts } from "@/lib/posts";
export const revalidate = 3600;
export default async function BlogPage() {
const posts = await getPublishedPosts();
return (
<main>
<h1>Engineering Blog</h1>
<ul>
{posts.map((post) => (
<li key={post.slug}>
<a href={`/blog/${post.slug}`}>
{post.title}
</a>
</li>
))}
</ul>
</main>
);
}In the conventional App Router route-segment configuration model, revalidate = 3600 establishes a one-hour revalidation interval for the route. The exact effect depends on the route's other data dependencies and caching settings. This example assumes the data access is compatible with the configured static rendering behavior. The sequence is conceptually simple: 1. Next.js generates the page and caches the output. 2. The configured interval elapses. 3. A subsequent request can trigger revalidation. 4. The existing cached page can be served while regeneration occurs. 5. After successful regeneration, subsequent requests can receive the updated output. The interval does not mean a background task necessarily regenerates every page at the exact sixtieth minute. Under the documented time-based ISR model, a request after the interval is what triggers revalidation. If nobody visits the page, there may be no immediate reason to regenerate it. This distinction matters for websites with many routes. A large content collection does not necessarily need every page regenerated at the same time.
On-demand revalidation for CMS updates
Time-based regeneration is convenient, but a CMS can often identify the exact moment when content changes. When an editor publishes an article, the application can invalidate the relevant cached path or tagged data rather than waiting for a general interval. For example, a publishing workflow might update /blog/database-indexes and the /blog index. It could trigger a protected revalidation endpoint or server-side action after the database transaction commits. In the App Router, revalidatePath and revalidateTag support on-demand invalidation workflows. Their precise semantics, including cache-profile options in current versions, should be checked against the Next.js version in use.
// app/api/revalidate/route.ts
import { revalidatePath } from "next/cache";
import { NextRequest, NextResponse } from "next/server";
export async function POST(request: NextRequest) {
const secret = process.env.CMS_REVALIDATION_SECRET;
if (!secret || request.headers.get("authorization") !== `Bearer ${secret}`) {
return NextResponse.json(
{ error: "Unauthorized" },
{ status: 401 }
);
}
const body = await request.json();
const slug = body.slug;
if (
typeof slug !== "string" ||
!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)
) {
return NextResponse.json(
{ error: "Invalid slug" },
{ status: 400 }
);
}
revalidatePath(`/blog/${slug}`);
revalidatePath("/blog");
return NextResponse.json({ revalidated: true });
}This is an illustrative endpoint, not a complete production integration. The caller must authenticate securely, and the CMS integration must send the request only after the relevant content update has succeeded. The secret must remain on the server and must never be exposed in client-side JavaScript. The slug validation reduces the chance of accidentally invalidating an unintended path. A real integration should also validate the request body, handle malformed JSON, apply appropriate rate limits, and record failures. One further distinction matters: a successful invalidation response does not necessarily mean every affected page has already been regenerated. Invalidation and regeneration are separate operations. In common App Router ISR workflows, the next relevant request can trigger regeneration. If the publishing workflow requires a newly published article to be available immediately, test the actual end-to-end behavior instead of treating an HTTP success response as proof that fresh HTML is already being served everywhere.
Advantages and limitations of ISR
- Efficient repeated delivery: Visitors can reuse previously rendered output.
- Reduced rebuild pressure: Content can change without requiring a complete deployment for each edit.
- Configurable freshness: Time-based and on-demand invalidation can support different publishing workflows.
- On-demand route generation: Depending on route configuration, paths omitted from the initial build can be generated when requested.
- Cache complexity: The team must understand invalidation, data dependencies, and how generated output is stored.
- Platform considerations: Self-hosted deployments with multiple application instances may need shared or coordinated cache storage.
- Not universal: ISR is not supported in Next.js static export mode; it requires a compatible server or hosting implementation.
ISR is often a strong default for public content that changes occasionally and receives repeated traffic. But it is not a magical combination that automatically gives every page instant responses and perfectly fresh data. A poorly designed invalidation workflow can leave content stale. An aggressive revalidation policy can create unnecessary work. A deployment with multiple instances can behave inconsistently if cache coordination is not configured appropriately. The strategy works best when its freshness guarantees are explicit and tested.
5. SSG vs SSR vs ISR: A Technical Comparison
| Dimension | SSG | SSR | ISR |
|---|---|---|---|
| Rendering time | Ahead of requests, typically during build | During a request | Initial generation and subsequent regeneration |
| Repeated server rendering | Usually avoided for cached output | Needed when the route renders dynamically per request | Usually avoided between regenerations |
| Content freshness | Updated by rebuilding or another supported invalidation mechanism | Can reflect request-time data when configured appropriately | Updated according to revalidation and invalidation behavior |
| Personalized HTML | Not suitable as one shared user-specific page | Suitable when request-dependent rendering is configured | Shared static output is unsuitable for private per-user content |
| Database pressure | Often concentrated around builds | Potentially repeated for incoming requests | Concentrated around generation and regeneration |
| Build cost | Can increase with the number of prerendered routes | Generally less build-time page generation | Can prebuild selected routes and generate eligible others later |
| Operational complexity | Low for stable content | Requires capacity and request-time monitoring | Requires cache and regeneration monitoring |
| Typical examples | About pages, stable project descriptions | Personalized dashboards, request-dependent pages | Blogs, documentation, public CMS pages |
The comparison describes common architectural patterns rather than universal guarantees. Actual behavior depends on the Next.js version, route configuration, data caching, deployment platform, and CDN setup. In particular, a database-backed route is not automatically SSR, and an SSR route does not necessarily perform every data query on every request. Similarly, ISR does not mean every request regenerates the page. The decisive factor is how the route and its dependencies are configured. It is also important to separate the initial build from runtime generation. A route can be prerendered at deployment and later regenerated without rebuilding the whole application. Conversely, an application that depends on request-time information may need dynamic rendering even when most of its shared data is cached.
6. Rendering Is Not the Same as Caching
One of the most common mistakes when learning Next.js is treating rendering and caching as the same decision. Rendering determines how the page output is produced. Caching determines whether data or previously generated output can be reused, where it is stored, and when it becomes invalid. For example, a dynamically rendered page can use cached public data while still generating a request-specific response. A static page can include interactive client-side components. An ISR page can reuse cached HTML while refreshing its content according to a revalidation policy. Next.js has several caching layers and mechanisms. Depending on the version and configuration, these can include request memoization, caching of fetched data, caching of rendered route output, and client-side Router Cache behavior. Their lifetimes and invalidation rules differ. Request memoization can avoid repeating equivalent work within a single rendering operation. A persistent data cache can reuse results across requests. A route-output cache can reuse a generated page. The client-side Router Cache helps with navigation within the application. These mechanisms should not be assumed to have identical defaults. Next.js caching behavior has evolved across releases, so code written for an older App Router version may not have the same behavior in a newer application.
| Concern | Question it answers | Example |
|---|---|---|
| Rendering | When is page output generated? | Build time or request time |
| Data caching | Can retrieved data be reused? | Reuse a cached list of public projects |
| Route caching | Can rendered output be reused? | Serve a previously generated article |
| Invalidation | When does cached information become stale or expire? | Revalidate an article after publication |
| Client navigation | Can route information be reused in the browser? | Navigate between pages without a full document reload |
Suppose a portfolio page displays a developer's public project descriptions alongside a current notification count for the signed-in owner. The project descriptions could be fetched through a cacheable data path, while the notification count must be evaluated using the appropriate authenticated request context. It may be possible to keep these responsibilities separate instead of making the entire page depend on one rendering strategy. Modern Next.js supports composition patterns for mixing static and dynamic regions, subject to the framework version and its caching configuration. The important architectural goal is to avoid turning a small request-specific requirement into unnecessary work for the entire application.
7. Performance, Server Costs, and Scalability
Rendering strategy affects infrastructure costs because it determines how often work must be repeated. But selecting the cheapest strategy by name is not a reliable way to optimize a system. Consider a popular article that receives 100,000 visits per day. If its content changes once a week, regenerating its HTML repeatedly for each visitor may waste CPU time and database capacity. Static generation or ISR can make better use of reusable output. Now consider a private dashboard whose content varies by user. Generating one shared HTML document and serving it to everyone is not a valid optimization. The response must respect the user's authorization and data boundaries. A useful cost model considers the amount of request-time rendering, the number and complexity of data queries, cache hit rates, revalidation frequency, build duration, and infrastructure pricing. The total cost also includes the operational effort required to keep content correct. A strategy that saves a small amount of compute but causes confusing publishing delays or cache bugs may not be the better engineering decision.
What changes at higher traffic?
- With SSG, traffic increases do not necessarily increase page-rendering work proportionally because generated output can be reused.
- With SSR, additional requests can increase rendering and data-access work unless caching or other optimizations reduce that work.
- With ISR, many requests can reuse the same generated page between regeneration events, although cache misses and regeneration still consume resources.
- With all three strategies, slow queries, oversized responses, excessive JavaScript, and poor asset delivery can still undermine performance.
A CDN can improve delivery of reusable content, but it does not automatically make every route cacheable. Authentication, response headers, request variation, and platform configuration determine what can safely be cached at the edge. Likewise, a high ISR cache hit rate does not prove that the system is healthy. It is also necessary to measure regeneration failures, content freshness, database load, and the latency experienced by real visitors. For meaningful comparisons, benchmark a production build under representative conditions. Development mode behaves differently from production, and results from a small local test do not establish how the application will perform under substantial traffic.
8. SEO and Search Engine Optimization
All three strategies can support search engine optimization. The important factor is whether search engines and visitors receive useful, accessible, crawlable content with correct metadata and URLs. Static generation makes it straightforward to deliver complete HTML for public pages. SSR can generate request-time HTML that includes the content and metadata needed for a particular route. ISR can combine reusable HTML with controlled content updates. None of these strategies guarantees better rankings by itself. Search engines evaluate many signals, including content relevance, internal linking, page experience, canonicalization, and whether a page can be crawled and indexed. For a portfolio, project pages and technical articles should generally be publicly accessible, contain meaningful titles and descriptions, and expose their primary content without requiring a visitor to sign in. Static generation or ISR is often suitable for these pages because their core content is shared among visitors. Personalized dashboards are a different case. They usually should not be publicly indexed because they contain private, user-specific information. Rendering them dynamically does not replace the need for appropriate authentication, authorization, and indexing controls.
Metadata and freshness
A page's title, description, canonical URL, and structured data should correspond to the actual content being served. If a CMS editor changes an article title, the publishing workflow may need to invalidate both the article route and any listing pages whose metadata or links depend on that change. This is where ISR and on-demand revalidation can help. However, the invalidation scope must reflect the data dependencies. Updating a post may affect its detail page, the blog index, category listings, related-article sections, and possibly an XML sitemap. The sitemap itself needs a strategy for reflecting new and removed URLs. Revalidating one article path does not automatically establish that every related route and generated asset has been updated. The practical lesson is simple: treat metadata and content as part of the publishing workflow, not as an unrelated SEO layer.
9. Choosing a Strategy for a Portfolio and CMS
A developer portfolio provides a useful example because different routes have different requirements, even though they belong to the same website. The homepage usually displays a stable introduction, selected projects, and links to published articles. Individual project pages explain implementation details and technology choices. Blog pages contain long-form content maintained through a CMS. An administrative interface may expose unpublished drafts, editing tools, and private operational information. Applying one rendering strategy to every route simply because it is convenient ignores these differences. A more defensible approach is to classify each route according to its data dependencies, freshness requirements, and privacy constraints. Start with the simplest approach that satisfies the requirement, then introduce more complex caching or rendering behavior only where it provides a measurable benefit.
| Route or feature | Suggested approach | Reason |
|---|---|---|
| Homepage | SSG or ISR | Public content changes infrequently |
| About page | SSG | Mostly stable information |
| Project details | SSG or ISR | Shared content with occasional edits |
| Blog article | ISR | Updates should not require a complete site rebuild |
| Blog listing | SSG or ISR | Public listing can be cached and refreshed |
| Category pages | SSG or ISR | Shared content with predictable dependencies |
| Private CMS editor | Dynamic rendering | User-specific authorization and request context |
| Account dashboard | Dynamic rendering | Data depends on the authenticated user |
| Live operational status | Dynamic rendering or an appropriate live-data architecture | Freshness requirements may exceed a static revalidation interval |
For a personal portfolio with a modest number of projects, SSG is an excellent starting point. It keeps public pages simple and reduces repeated work. For a CMS-driven blog where articles are added and edited regularly, ISR often offers a better balance. A publication event can trigger invalidation for the article and affected listings, while most visitors continue receiving reusable rendered output. For a private editor or dashboard, request-dependent rendering is more appropriate where the response depends on the current user's identity or permissions. Any cached data used by these routes must be scoped correctly to prevent one user's information from being exposed to another. These choices are not mutually exclusive at the application level. A well-structured Next.js application can use different approaches for different route segments and data dependencies.
10. Common Mistakes and How to Avoid Them
Mistake 1: Assuming a database requires SSR
A database is a data source, not a rendering strategy. A public article retrieved from PostgreSQL can be rendered statically and refreshed when it changes. The database query does not have to run for every visitor. The correct question is whether the data must be evaluated at request time. If the answer is no, consider whether the output can be generated and reused safely.
Mistake 2: Using extremely short revalidation intervals without a reason
Setting a revalidation interval of one second does not automatically make a site meaningfully more current. It may increase regeneration work without delivering the freshness guarantee the application actually needs. Choose an interval based on how quickly content changes, how much staleness is acceptable, and the expected cost of regeneration. If editors need updates to appear promptly, use an appropriate on-demand invalidation workflow rather than relying exclusively on a tiny time interval.
Mistake 3: Forgetting dependent pages
Publishing an article can affect more than its detail page. The homepage might show recent posts, the category page might include the new article, and the blog index might need updated links and descriptions. Map these dependencies explicitly. If a post update invalidates only its own route, other pages may continue showing stale content until their respective caches are refreshed.
Mistake 4: Confusing a successful invalidation with fresh content
An invalidation event and a completed regeneration are different events. Depending on the revalidation mechanism, a request may invalidate cached entries while actual page generation occurs on a subsequent visit. Test the complete publishing lifecycle: edit content, publish it, trigger invalidation, request the affected page, and confirm the new content appears. Also verify the behavior when regeneration fails.
Mistake 5: Accidentally caching private information
Caching is a correctness and security concern, not just a performance optimization. If a response contains account-specific information, the application must ensure that it cannot be reused across users inappropriately. Keep authorization checks on the server and understand which data and route outputs are cached. Do not rely on hiding private content in the client or assuming that a dynamically rendered route automatically makes every underlying data cache safe.
Mistake 6: Assuming local development proves production behavior
Rendering and cache behavior should be tested using the production build and the deployment configuration intended for release. Development mode has different characteristics, and a single-instance local test may not expose shared-cache problems across multiple containers. For self-hosted deployments, investigate how cached output persists across restarts and whether multiple instances use compatible cache storage and invalidation. A strategy that works on one server may need additional infrastructure when the application scales horizontally.
11. A Practical Decision Framework
Before choosing a rendering strategy, answer three questions. First, is the rendered output shared among visitors, or does it depend on a particular request or authenticated user? Second, how quickly must published changes become visible? Third, how much repeated computation can the system reasonably afford? For stable public content, SSG is generally the simplest option. For public content that changes occasionally and can tolerate a defined revalidation process, ISR is often a better fit. For output that depends on request-specific information, dynamic rendering is usually the appropriate starting point. Next, determine the caching and invalidation behavior independently. Identify which data can be shared, which routes depend on it, and what event should invalidate each relevant cache entry. Finally, measure the result. Record response latency, database query volume, build duration, regeneration errors, and the time between publishing an edit and seeing it on the public site. These measurements are more useful than choosing a strategy based on framework terminology alone.
- Before shipping, verify the following:
- [ ] Public pages expose the correct HTML, metadata, and canonical URLs.
- [ ] User-specific pages enforce authentication and authorization.
- [ ] Cache settings match the requirements for data freshness.
- [ ] CMS publication invalidates every affected route or data dependency.
- [ ] Revalidation failures are observable and recoverable.
- [ ] Production behavior has been tested with the intended deployment platform.
- [ ] Performance decisions are supported by measurements rather than assumptions.
Conclusion
Static generation, server rendering, and incremental static regeneration are different tools for managing the timing and reuse of rendered output. SSG is a strong choice for stable public pages that can be generated ahead of time. SSR is appropriate when a response must depend on request-specific information. ISR is useful when shared public content changes occasionally and should be refreshed without rebuilding the entire application. The strongest Next.js architecture does not force every route into one category. It makes rendering, caching, and invalidation decisions based on each route's actual requirements. For a portfolio and CMS, that often means statically generating stable pages, incrementally regenerating published articles, and dynamically rendering private editing interfaces. Start with that separation, test the freshness and security guarantees, and optimize only when measurements justify additional complexity. The goal is not to make every page static or every request dynamic. It is to avoid repeating work that can be safely reused while ensuring that information is current and access-controlled wherever it matters.
OPEN
Thoughts on the article.