The Problem With "Just Use Static"
When I first adopted Next.js, I defaulted to getStaticProps everywhere. Pages loaded instantly. Lighthouse was happy. Then a client asked why their product prices weren't updating until the next deploy.
That conversation forced me to actually understand the trade-off triangle: freshness vs. speed vs. infrastructure cost.
SSG — Static Site Generation
``ts
// app/blog/[slug]/page.tsx
export async function generateStaticParams() {
const posts = await fetchAllPosts()
return posts.map((post) => ({ slug: post.slug }))
}
export default async function BlogPage({ params }: { params: { slug: string } }) {
const post = await fetchPost(params.slug)
return
}
`
- Content that rarely changes (blogs, docs, marketing pages)
- Data that can tolerate being slightly stale
- Maximum performance requirements
SSR — Server-Side Rendering
`ts
// Forces dynamic rendering
export const dynamic = 'force-dynamic'
export default async function DashboardPage() {
const user = await getCurrentUser()
const stats = await fetchUserStats(user.id) // fresh every request
return
}
`
- User-specific data (dashboards, account pages)
- Pages that depend on request cookies/headers
- Content that must be 100% fresh on every load
ISR — Incremental Static Regeneration
This is where Next.js truly shines. Generate static at build time, regenerate in the background after N seconds.
`ts
export const revalidate = 60 // revalidate every 60 seconds
export default async function ProductPage({ params }: { params: { id: string } }) {
const product = await fetchProduct(params.id)
return
}
``
When to use ISR:- E-commerce product pages
- News articles
- Any content that changes, but not on every request
Benchmarks From Production
| Strategy | TTFB | Infra Cost | Freshness |
| SSG | ~50ms | Very Low | Build-time |
| ISR (60s)| ~50ms | Low | Up to 60s stale | |
| SSR | ~200ms| Medium | Always fresh |
My Mental Model