This project demonstrates different rendering methods in Next.js, including Client-Side Rendering (CSR), Time-Based Incremental Static Regeneration (ISR), On-Demand ISR, and Server-Side Rendering (SSR).
ISR features only work in production builds. When running in development mode (pnpm dev
), you won't see the actual caching behavior of ISR. To properly test and see ISR in action:
# Build the production version
pnpm build
# Run the production server
pnpm start
First, install dependencies:
pnpm install
For development (note: ISR won't work properly):
pnpm dev
For production (recommended to see ISR in action):
pnpm build
pnpm start
Open http://localhost:3000 with your browser to see the result.
This demo illustrates the different rendering strategies in Next.js and when to use each:
-
Client-Side Rendering (CSR): Data fetched in the browser after page load. Good for personalized or frequently changing content.
-
Time-Based ISR: Pages cached and regenerated at fixed intervals. Balances performance with freshness.
-
On-Demand ISR: Pages cached until manually revalidated. Perfect for content that changes on specific events.
-
Server-Side Rendering (SSR): Fresh data on every request. Ideal for highly dynamic content that needs SEO.
The demo is built with a mobile-first approach using:
- Tailwind CSS for responsive styling
- Shadcn UI components for a consistent design system
- Accessible color contrasts and responsive layouts
To learn more about Next.js rendering methods:
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.