@astrojs/vercel
11.0.22 · 13 Nov 2026MIT790.2k / weekRepositoryHomepagenpmAtom feed
7.8.2 is the newest release of 7.x.
In short
1 new
Security
1 advisory affects 7.2.0; 10.0.2 fixes them
- ModerateAstro: Unauthenticated Path Override via `x-astro-path` / `x_astro_path`GHSA-mr6q-rp88-fx84 · 26 Mar 2026Fixed in 10.0.2
Release note
Minor Changes
Introduces a new config option,
isr, that allows you to deploy your project as an ISR function. ISR (Incremental Static Regeneration) caches your on-demand rendered pages in the same way as prerendered pages after first request.To enable this feature, set
isrto true in your Vercel adapter configuration inastro.config.mjs:export default defineConfig({ output: 'server', adapter: vercel({ isr: true }), });
Cache invalidation options
By default, ISR responses are cached for the duration of your deployment. You can further control caching by setting an `expiration` time or prevent caching entirely for certain routes.
Time-based invalidation
You can change the length of time to cache routes this by configuring an `expiration` value in seconds:
```js
export default defineConfig({
output: 'server',
adapter: vercel({
isr: {
// caches all pages on first request and saves for 1 day
expiration: 60 * 60 * 24,
},
}),
});
```Manual invalidation
To implement Vercel's [Draft mode](https://vercel.com/docs/build-output-api/v3/features#draft-mode), or [On-Demand Incremental Static Regeneration (ISR)](https://vercel.com/docs/build-output-api/v3/features#on-demand-incremental-static-regeneration-isr), you can create a bypass token and provide it to the `isr` config along with the paths to exclude from caching:
```js
export default defineConfig({
output: 'server',
adapter: vercel({
isr: {
// A secret random string that you create.
bypassToken: '005556d774a8',
// Paths that will always be served fresh.
exclude: ['/api/invalidate'],
},
}),
});
```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.