Choose SSR, SSG or ISR for each route in a Next.js app
Decide the rendering and caching strategy for every route in your Next.js project (static, ISR, dynamic, streaming or client) with a reasoned table, sample code and how to verify it. Designed for ChatGPT, Claude, Gemini and Microsoft Copilot. It includes 4 customizable variables and you can copy it for free in one click.
Advanced · Text · Pending editorial review
Prompt
Act as an architect who specializes in the Next.js App Router, web performance and technical SEO.
Context:
- Project: {{project}}
- Routes and data freshness: {{routes}}
- Hosting: {{hosting}}
- Next.js version: {{next_version}}
If decisive information is missing (which routes depend on the user session, how often data changes, whether content comes from a CMS with webhooks), ask me before deciding.
Deliverables:
1. A table per route: strategy (static at build time, static with time-based or on-demand revalidation, dynamic per request, streaming with Suspense, client-side fetching), reason, data source, impact on SEO and on time to first byte.
2. How content gets invalidated in each case (time-based revalidation, revalidatePath or revalidateTag from a webhook) and what happens if revalidation fails.
3. What accidentally turns a route dynamic (cookies, headers, search params, uncached fetches) and how to isolate the personalized part so the rest stays static.
4. Short sample code for two or three representative routes.
5. Limitations of {{hosting}} that affect the decision (for example, static export cannot render per request).
6. How to verify: what the `next build` output shows for each route and which cache headers to check in production.
Constraints:
- Default caching behavior has changed between Next.js versions: state what you assume for {{next_version}} and recommend checking the official docs for that version.
- Do not invent performance metrics; if you estimate something, mark it as an estimate.
- Prefer static whenever freshness requirements allow it.
Output format: main table, short sections per topic and a final list of risks.How to use it
- List your real routes with how often their content changes and whether they depend on the user. 2. Say where you deploy and the exact Next.js version. 3. Apply the table and validate with the next build output before shipping.
Usage example
Project: furniture store with a blog · Routes: /, /products/[slug] (prices change daily), /blog/[slug], /account (private) · Hosting: Vercel · Version: Next.js 15.
Sample output
Assumption: Next.js 15, where fetch is no longer cached by default. Check the official docs for your version.
Strategy per route
| Route | Strategy | Reason | Invalidation |
|---|---|---|---|
/ | Static with revalidation | Changes weekly | revalidateTag('home') from the CMS |
/products/[slug] | Static + ISR; price and stock in a Suspense block | SEO needs fast HTML; stock changes daily | revalidateTag('product:slug') on inventory update |
/blog/[slug] | Static with generateStaticParams | Rarely changes | revalidatePath from the CMS webhook |
/account | Dynamic per request | Private, per user; reads cookies | Not cached |
What accidentally makes a route dynamic
- Reading
cookies()orheaders()in a shared layout: it drags every child route along. - Using
searchParamson the product page for a minor filter.
Fix: isolate the personalized part (cart, greeting) in a client component or a Suspense block so the rest stays static.
How to verify
In the next build output, each route is marked static (○), SSG (●) or dynamic (ƒ). If /products/[slug] shows ƒ, something is reading request data…
Key facts
- Category
- Programming & development · Next.js
- Output type
- Text
- Level
- Advanced
- Designed for
- ChatGPT, Claude, Gemini and Microsoft Copilot
- Verified in
- Pending editorial verification
- Variables
- Project, Routes and data freshness, Hosting and Next.js version
- Language
- English
- Price
- Free, no sign-up
- Updated
- Nov 7, 2026
Frequently asked questions
What is the difference between SSG and ISR?
With SSG the page is generated at build time and stays the same until the next deploy. With ISR it is served statically but regenerated after an interval or when you invalidate it, without redeploying.
Is server rendering always better for SEO?
What matters for SEO is that the initial HTML contains the content. A static or ISR page achieves that just like SSR and is usually faster and cheaper to serve.
Why does a route turn dynamic when I did not intend it?
Usually because it reads cookies, headers or search params, or runs an uncached fetch. The prompt helps you find those calls and isolate them.
What is this prompt for?
Decide the rendering and caching strategy for every route in your Next.js project (static, ISR, dynamic, streaming or client) with a reasoned table, sample code and how to verify it.
Which AI tools does it work with?
It is designed for ChatGPT, Claude, Gemini and Microsoft Copilot. We have not verified it in these tools yet, so results may vary between them.
How do I customize the prompt?
Click “Customize” and fill in the variables (Project, Routes and data freshness, Hosting and Next.js version). The text updates instantly and you can then copy it in one click. Values are stored only in your browser.
Do I need experience to use it?
It is advanced: it is meant for people with experience in the topic who can evaluate and adjust the result.
Is this prompt free?
Yes. Every HomeCasa Prompts prompt is free, with no sign-up or subscription. You can also use them in professional projects.
Can I trust the AI output?
Treat it as a high-quality draft: always check data, figures and important claims before publishing or making decisions.