Data Cache & Revalidation
Cached fetch with 10-second revalidation.
This server component fetches from a local Route Handler using fetch(..., { next: { revalidate: 10 } }). The result is cached by the Next.js Data Cache and refreshed in the background.
Data from Route Handler
2026-04-18T06:26:11.455Z
Source: self-hosted Route Handler
Node: v24.13.0
Page rendered at
2026-04-18T10:14:33.576Z
Compare these two timestamps to see caching in action.
How to verify
- The Route Handler at
/api/showcase/timealways returns a fresh timestamp. - But this page caches the fetch result for 10 seconds.
- Refresh immediately. The data timestamp stays the same.
- After 10 seconds, the next request triggers a background revalidation and the data timestamp updates.
What this proves
- •The Next.js Data Cache works self-hosted, not just on Vercel.
- •Route Handlers and cached fetches work together on the VPS.
- •This is per-fetch caching, not whole-page ISR, so different data sources can have different revalidation intervals.