Cache

Vercel Cache

Last updated December 1, 2025

Vercel's CDN Cache caches your content at the edge in order to serve data to your users as fast as possible. Vercel's caching is available for all deployments and domains on your account, regardless of the pricing plan.

Vercel uses the CDN to cache your content globally and serve data to your users as quickly as possible. There are two ways to cache content:

  • Static file caching is automatic for all deployments, requiring no manual configuration
  • To cache dynamic content, including SSR content, you can use headers

You can cache responses on Vercel with headers defined in:

  1. Responses from Vercel Functions
  2. Route definitions in or

You can use any combination of the above options, but if you return headers in a Vercel Function, it will override the headers defined for the same route in or .

To cache the response of Functions on Vercel's CDN, you must include headers with any of the following directives:

and are not currently supported.

The following example demonstrates a function that caches its response and revalidates it every 1 second:

For direct control over caching on Vercel and downstream CDNs, you can use CDN-Cache-Control headers.

You can define route headers in or files. These headers will be overridden by headers defined in Function responses.

The following example demonstrates a file that adds headers to a route:

If you're building your app with Next.js, you should use rather than . The following example demonstrates a file that adds headers to a route:

See the Next docs to learn more about .

Static files are automatically cached at the edge on Vercel's CDN for the lifetime of the deployment after the first request.

  • If a static file is unchanged, the cached value can persist across deployments due to the hash used in the filename
  • Optimized images cached will persist across deployments for both static images and remote images

Where is the number of seconds the response should be cached. The response must also meet the caching criteria.

You can cache dynamic content through Vercel Functions, including SSR, by adding headers to your response. When you specify headers in a function, responses will be cached in the region the function was requested from.

See our docs on Cache-Control headers to learn how to best use directives on Vercel's CDN.

Vercel supports two Targeted Cache-Control headers:

  • , which allows you to control the Vercel Cache or other CDN cache separately from the browser's cache. The browser will not be affected by this header
  • , which allows you to specifically control Vercel's Cache. Neither other CDNs nor the browser will be affected by this header

By default, the headers returned to the browser are as follows:

headers are not returned to the browser or forwarded to other CDNs.

To learn how these headers work in detail, see our dedicated headers docs.

The following example demonstrates headers that instruct:

  • Vercel's Cache to have a TTL of seconds
  • Downstream CDNs to have a TTL of seconds
  • Clients to have a TTL of seconds

If you set without a , the Vercel CDN strips and from the response before sending it to the browser. To determine if the response was served from the cache, check the header in the response.

The response header instructs caches to use specific request headers as part of the cache key. This allows you to serve different cached responses to different users based on their request headers.

The header only has an effect when used in combination with headers that enable caching (such as ). Without a caching directive, the header has no behavior.

When Vercel's CDN receives a request, it combines the cache key (described in the Cache Invalidation section) with the values of any request headers specified in the header to create a unique cache entry for each distinct combination.

Vercel's CDN already includes the and headers as part of the cache key by default. You do not need to explicitly include these headers in your header.

The most common use case for the header is content negotiation, serving different content based on:

  • User location (e.g., )
  • Device type (e.g., )
  • Language preferences (e.g., )

Example: Country-specific content

You can use the header with Vercel's request header to cache different responses for users from different countries:

You can set the header in the same ways you set other response headers:

In Vercel Functions

Using

Using

If you're building your app with Next.js, use :

You can specify multiple headers in a single value by separating them with commas:

This will create separate cache entries for each unique combination of country and language preference.

  • Use headers selectively, as each additional header exponentially increases the number of cache entries — this doesn't directly impact your bill, but can result in more cache misses than desired
  • Only include headers that meaningfully impact content generation
  • Consider combining multiple variations into a single header value when possible

The field is an HTTP header specifying caching rules for client (browser) requests and server responses. A cache must obey the requirements defined in the header.

For server responses to be successfully cached with Vercel's CDN, the following criteria must be met:

  • Request uses or method.
  • Request does not contain header.
  • Request does not contain header.
  • Response uses , , , , or status code.
  • Response does not exceed in content length.
  • Response does not contain the header.
  • Response does not contain the , or directives in the header.
  • Response does not contain header, which is treated as equivalent to .

Vercel does not allow bypassing the cache for static files by design.

To learn about cache keys, manually purging the cache, and the differences between invalidate and delete methods, see Purging Vercel Cache.

The header is included in HTTP responses to the client, and describes the state of the cache.

See our headers docs to learn more.

Vercel's Edge Cache is segmented by region. The following caching limits apply to Vercel Function responses:

  • Max cacheable response size:
    • Streaming functions: 20MB
    • Non-streaming functions: 10MB
  • Max cache time: 1 year

While you can put the maximum time for server-side caching, cache times are best-effort and not guaranteed. If an asset is requested often, it is more likely to live the entire duration. If your asset is rarely requested (e.g. once a day), it may be evicted from the regional cache.

Vercel does not currently support using and for server-side caching.


Was this helpful?

supported.