Data Cache for Next.js

Data Cache is available in Beta on all plans

The Vercel Data Cache is a specialized, granular cache that was introduced with Next.js 13 for storing segment-level data while using Next.js App Router.

When using Next.js caching APIs such as fetch or unstable_cache, Vercel automatically scaffolds globally distributed infrastructure for you with no additional configuration.

  • Globally available, regional cache: Every region in which your function runs has an independent cache, so any data used in server side rendering or Next.js route handlers is cached close to where the function executes.
  • Time-based revalidation: All cached data can define a revalidation interval, after which the data will be marked as stale, triggering a re-fetch from origin.
  • On-demand revalidation: Any data can be triggered for revalidation on-demand, regardless of the revalidation interval. The revalidation propagates to all regions within 300ms.
  • Tag based revalidation: Next.js allows associating tags with data, which can be used to revalidate all data with the same tag at once with revalidateTag. For example, you can revalidate all responses from a CMS with the same author ID tag.

Next.js combines Vercel Data Cache with Incremental Static Regeneration (ISR) to provide an optimized caching infrastructure for your pages.

When a page contains entirely static data, Vercel uses ISR to generate the whole page. However, when a page contains a mix of static and dynamic data, the dynamic data is re-fetched when rendering the page. In this scenario, Vercel Data Cache is used to cache the static part of the data to avoid slow origin fetches.

Both ISR and Vercel Data Cache support time-based revalidation, on-demand revalidation, and tag based revalidation.

Vercel's Cache is used for caching entire static assets at the edge, such as images, fonts, and JavaScript bundles. The Vercel Data Cache is used for caching data fetched during a function's execution, such as API responses.

When you deploy a Next.js project that uses App Router to Vercel, the Vercel Data Cache is automatically enabled to cache segment-level data alongside ISR in the app router.

You can observe your project's Data Cache usage using the Observability tab under your project in the Vercel dashboard. The Runtime Cache tab provides visibility into what's stored in your project's Data Cache along with insights like your cache hit rate and the number of cache reads, cache writes, and on-demand revalidations. To view your usage for Data Cache:

You can also track Data Cache usage per request in the Logs tab under the log's request metrics section.

You need to have an owner role to perform this task.

In some circumstances, you may need to delete all cached data and force revalidation. You can do this by purging the Data Cache:

  1. Under your project, go to the Settings tab.
  2. In the left sidebar, select Caches.
  3. In the Data Cache section, click Purge Data Cache.
  4. In the dialog, confirm that you wish to delete and click the Continue & Purge Data Cache button.

Purging your Data Cache will create a temporary increase in request times for users as new data needs to be refetched.

These examples use the Next.js App Router.

app/page.tsx
export default async function Page() {
  const res = await fetch('https://api.vercel.app/blog', {
    next: {
      revalidate: 3600, // 1 hour
    },
  });
  const data = await res.json();
 
  return '...';
}
app/page.tsx
export default async function Page() {
  const res = await fetch('https://api.vercel.app/blog', {
    next: {
      tags: ['blog'], // Invalidate with revalidateTag('blog') on-demand
    },
  });
  const data = await res.json();
 
  return '...';
}
app/actions.ts
'use server';
 
import { revalidateTag } from 'next/cache';
 
export default async function action() {
  revalidateTag('blog');
}

The Vercel Data Cache infrastructure isolates cached data per Vercel project and deployment environment (production or preview).

Vercel persists cached data across deployments, unless you explicitly invalidate it using framework api's like res.revalidate, revalidateTag and revalidatePath, or by manually purging Vercel Cache. It is not updated at build time. When invalidated, Vercel updates the data at run time, triggered by the next request to the invalidated path.

When the system triggers a revalidation, Vercel marks the corresponding path or cache tag as stale in every Vercel Edge Network region. The next request to that path or tag, regardless of the region, initiates revalidation and updates the cache globally. Vercel purges and updates the regional cache in all regions within 300ms.

Data Cache propertyLimit
Item size2 MB (items larger won't be cached)
Tags per item64 tags
Maximum tag length256 bytes
Last updated on August 5, 2025