Skip to main content

Serve personalized content faster with Vary support

By Steven Van ·

Vercel's CDN now caches country- or language-specific page versions via the Vary header, on any plan with no setup.

Vercel's CDN now fully supports the HTTP Vary header, so sites can cache personalized content on every plan without extra configuration. The header tells the Vercel CDN which request headers to fold into the cache key, letting it store separate cached versions of a page for values like X-Vercel-IP-Country or Accept-Language. Vary only takes effect alongside a Cache-Control header that enables caching, such as s-maxage; on its own it does nothing.

In practice, a site can return Vary: X-Vercel-IP-Country with Cache-Control: s-maxage=60 and have a visitor from the United States served the US-specific cached page while visitors elsewhere get the cached version for their own country, with no recomputation on either request.

Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →

Original source

Read Serve personalized content faster with Vary support on Creators Toolbox