Back to ⚡ Performance & Optimization

Setup Incremental Static Regeneration

Next.jsPerformanceCaching
---
description: Serve static pages with auto-updates
---

1. **Enable ISR**:
export const revalidate = 60; // seconds

export default async function Page() {
const data = await fetchData();
return <div>{data}</div>;
}


2. **On-Demand Revalidation**:
import { revalidatePath } from 'next/cache';

export async function POST(request: Request) {
const { path } = await request.json();
revalidatePath(path);
return Response.json({ revalidated: true });
}


3. **Pro Tips**:
- Use tags for bulk revalidation.
- Perfect for blogs and e-commerce.
By Antigravity Team

How to Use This Workflow

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/workflows/
  3. Save the file as setup-incremental-static-regeneration-isr-nextjs.md
  4. In Antigravity, type /setup_incremental_static_regeneration_isr_nextjs or just describe what you want to do

Learn more about workflows →

Related Workflows

Recommended Rules

View more rules →

Recommended MCP Servers

View more MCP servers →

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide