@astrojs/vercel
11.0.22 · 13 Nov 2026MIT790.2k / weekRepositoryHomepagenpmAtom feed
Your version
11.0.22 is the newest release of 11.x.
In short
1 breaking1 new1 fixed
- Breaking
Upgrade to Vite v8
Security
1 advisory affects 11.0.0; 11.0.3 fixes them
- ModerateAstro: Unauthenticated path override in the @astrojs/vercel ISR functionGHSA-x27w-589x-frm2 · 20 Jul 2026Fixed in 11.0.3
Release note
Major Changes
- Breaking
Upgrade to Vite v8
Minor Changes
Adds a CDN cache provider for Astro route caching on Vercel
Caching responses
Use `Astro.cache.set()` in your pages and API routes to cache responses on Vercel's edge network. The provider sets `Vercel-CDN-Cache-Control` and `Vercel-Cache-Tag` headers on responses.
```astro
---
Astro.cache.set({ maxAge: 300, tags: ['products'] });
const data = await fetchProducts();
---
<ProductList items={data} />
```
You can also set cache rules for groups of routes in your config:
```js
cache: { provider: cacheVercel() },
routeRules: {
'/products/[...slug]': { maxAge: 3600, tags: ['products'] },
'/api/[...path]': { maxAge: 60, swr: 600 },
},
```Invalidation
Purge cached responses by tag or path from any API route or server endpoint:
```ts
// src/pages/api/purge.ts
export async function POST({ request, cache }) {
await cache.invalidate({ tags: ['products'] });
return new Response('Purged');
}
// Path-based invalidation
await cache.invalidate({ path: '/products/123' });
```
Both tag-based and path-based invalidation are supported. Tag invalidation is a soft invalidation, marking cached responses as stale so they can be revalidated in the background via stale-while-revalidate.Patch Changes
Triggers beta prereleases for packages that are still on alpha
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.