Quick test of ISR performance on Next.js using OpenNext/Cloudflare
A performance benchmarking application for Incremental Static Regeneration (ISR) in Next.js, deployed to Cloudflare Workers using OpenNext with optimized caching configuration.
This application demonstrates and benchmarks ISR performance using:
Our setup follows the “large site” architecture pattern with:
| Component | Implementation | Purpose |
|---|---|---|
| undefinedIncremental Cacheundefined | Workers KV | Ultra-fast global cache distribution |
| undefinedTag Cacheundefined | Sharded Durable Objects | High-load on-demand revalidation |
| undefinedQueueundefined | Durable Objects | Reliable ISR processing |
| undefinedCache Interceptionundefined | Enabled | Reduced cold start times |
| undefinedAuto Cache Purgeundefined | Direct mode | Immediate cache invalidation |
/demo/1, /demo/2, /demo/3/demo/foo, /demo/bar, /demo/baz/demo/test, /demo/hello, /demo/world, /demo/performance/demo/[slug] routeundefinedRevalidation: Every 10 seconds via ISR
# Install dependencies
npm install
# Start development server
npm run dev
# Preview with Workers runtime
npm run preview
# Build and deploy to Cloudflare
npm run deploy
# Or just build
npm run build
undefinedFirst Load Performanceundefined
undefinedCache Behaviorundefined
undefinedISR Revalidationundefined
├── app/
│ ├── page.tsx # Home page with benchmark info
│ └── demo/[slug]/page.tsx # ISR demo routes
├── open-next.config.ts # OpenNext configuration
├── wrangler.jsonc # Cloudflare Workers config
└── public/_headers # Static asset caching rules
open-next.config.tsexport default defineCloudflareConfig({
incrementalCache: kvIncrementalCache,
queue: doQueue,
tagCache: doShardedTagCache({ baseShardSize: 12 }),
enableCacheInterception: true,
cachePurge: purgeCache({ type: "direct" }),
});
NEXT_INC_CACHE_KV_PREFIX - KV cache key prefix (default: “incremental-cache”)NEXTJS_ENV - Environment for Next.js config loadingThis setup provides:
This is a demonstration project. Feel free to fork and experiment with different caching configurations or add additional benchmarking scenarios.