---
title: How can I share my Vercel cache across deployments?
description: Learn how to reuse cached responses across deployments with the Next.js App Router and the Vercel Data Cache.
url: /kb/guide/share-vercel-cache-across-deployments-nextjs
canonical_url: "https://vercel.com/kb/guide/share-vercel-cache-across-deployments-nextjs"
published: 2025-11-03
last_updated: 2025-12-07
authors: Lee Robinson
related:
  - /docs/infrastructure/data-cache
  - /docs/frameworks/nextjs
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Data Cache for Next.js](https://vercel.com/docs/caching/runtime-cache/data-cache?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Vercel Data Cache is a specialized cache that stores responses from data fetches in Next.js App Router
- [Vercel Data Cache: A progressive cache, integrated with Next.js](https://vercel.com/blog/vercel-cache-api-nextjs-cache?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related)
- [Introducing the Vercel Data Cache: Optimized caching for React Server Components](https://vercel.com/changelog/introducing-vercel-data-cache?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related)
- [Caching](https://vercel.com/docs/caching?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Learn how Vercel caches content across multiple layers to deliver fast responses and reduce load on your backend.
- [Runtime Cache](https://vercel.com/docs/caching/runtime-cache?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Vercel Runtime Cache is a specialized cache that stores responses from data fetches in Vercel functions
- [Vercel CDN Cache](https://vercel.com/docs/caching/cdn-cache?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Learn how Vercel's CDN cache stores your content across a global network to reduce latency and origin load.
- [Migrating to Cache Components](https://nextjs.org/docs/app/guides/migrating-to-cache-components?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Learn how to migrate from route segment configs to Cache Components in Next.js.
- [Troubleshooting Build Errors](https://vercel.com/docs/deployments/troubleshoot-a-build?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Learn how to resolve common scenarios you may encounter during the Build step, including build errors that cancel a depl
- [How to Configure the Cache-Control Response Header in Vercel Projects](https://vercel.com/kb/guide/how-to-configure-the-cache-control-response-header-in-vercel-projects?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — After reviewing this guide, you will be able to set a cache-control header of any value to be returned when a specific p
- [Manage cache tags for external origins](https://vercel.com/kb/guide/how-to-manage-cache-tags-for-external-origins?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Learn how to use cache tags to optimally serve fresh content on Vercel when content from your external origin changes
- [Set cache control headers for functions](https://vercel.com/kb/guide/set-cache-control-headers?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=related) — Learn how to set headers to cache your function's responses.

Full cross-link map for this page: [/kb/guide/share-vercel-cache-across-deployments-nextjs.graph.md](/kb/guide/share-vercel-cache-across-deployments-nextjs.graph.md?from=related&source_path=%2Fkb%2Fguide%2Fshare-vercel-cache-across-deployments-nextjs&source_site=vercel-kb&relationship=graph)
<!-- /docsgraph:related -->


When fetching data from external sources like a database or CMS, it can be beneficial to prevent re-fetching the same data if it has not changed by utilizing caching. This guide will explain how to use the Next.js App Router and the Vercel Data Cache to persist cached data across deployments.

## Requirements

To cache data and share responses across deployments, you must currently use the Next.js App Router (latest version recommended). You cannot share the cache between different projects.

### Next.js App Router

The [Next.js App Router](https://nextjs.org/docs/app) (`app/`) provides more [fine-grained control](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating) over fetching, caching, and revalidating your data. For example, you can fetch and cache data (using [`fetch`](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#fetching-data-on-the-server-with-fetch) or your favorite library) and [revalidate](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#revalidating-data) the data by cache tag or path by defining a [stale time](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#time-based-revalidation) or [programmatically purging](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#on-demand-revalidation) the cache.

### Vercel Data Cache

The [Vercel Data Cache](https://vercel.com/docs/infrastructure/data-cache) is a specialized, granular cache for storing responses from fetches while using modern frontend frameworks like [Next.js](https://vercel.com/docs/frameworks/nextjs). It's a shared cache, meaning users of the same project share the same cache.

Frameworks that integrate with the Data Cache (currently Next.js) can cache data per fetch instead of per route. This means you can have static, dynamic, and revalidated data together in the same route.

## Example

Inside your Next.js application, fetch and tag your data with a cache key:

```typescript
async function Blog() {
  const res = await fetch('https://api.vercel.app/blog', {
    next: { tags: ['blogs'] }
  });
  const blogs = await res.json();
 
  return '...';
}
```

The response from `fetch` will be cached and not re-fetched on the next deployment. Instead, to revalidate the data and purge the cache, you can use `revalidateTag`:

```typescript
'use server'
 
import { revalidateTag } from 'next/cache'
 
export default async function action() {
  revalidateTag('blogs')
}
```