import Link from 'next/link'; export default function CacheLabIndexPage() { return (

Cache Lab

Manual test pages for Next.js Cache Components (use cache, cacheLife, tags, updateTag/revalidateTag, and Suspense boundaries).

use cache: non-deterministic

Random/Date/UUID should stay identical across reloads until you invalidate.

cacheLife: short timings

Uses very small stale/revalidate/expire values so you can observe SWR + expiry quickly.

Tags: updateTag vs revalidateTag

Cached component tagged via cacheTag. Trigger updateTag (immediate) or revalidateTag (SWR).

SWR: stale-while-revalidate (slow)

Forces slow recomputation so you can see whether stale is served immediately while refresh happens in the background.

Runtime data + Suspense

Reads cookies() at request time in a non-cached component and passes it into a cached component to show correct boundaries.

How to use

Open each page in 2 tabs and compare behavior while reloading. Observe which values stay stable, and which update.

Use the buttons on each page to trigger tag invalidation and observe how quickly new content becomes visible.

); }