@astrojs/vercel
π Patch Changes
- Updated dependencies [
b7a1bd9]:- @astrojs/internal-helpers@0.13.0
- Updated dependencies [
π Patch Changes
- #18339
fcc050cThanks @astro-factory! - Fixes on-demand routes failing with βCannot find native bindingβ on Vercel, caused by the serverless function loadingrolldownat runtime
- #18339
π Patch Changes
- #18263
882dd98Thanks @florian-lefebvre! - Refactors internal bundling and code transforms to use Viteβs Oxc-basedtransformWithOxcand Rolldown instead of esbuild. These packages no longer depend on esbuild directly.
- #18263
π Patch Changes
- #18254
36f3a0cThanks @astro-factory! - Fixes middleware rewrites returning 404 instead of 200 when the 404 page is server-rendered - Updated dependencies [
6987261,62b13ba]:- @astrojs/internal-helpers@0.12.0
- #18254
π Patch Changes
-
#18044
98c07e1Thanks @astro-factory! - Fixes a rare issue where ISR pages on Vercel could intermittently be served a cached redirect to a nonsense URL (such as/$0/) instead of the page itself. Pages now render correctly, and requests that canβt be resolved to a valid path return a404instead of a redirect. -
#18008
a09b328Thanks @yanthomasdev! - Fixes the immutableCache-Controlrule for hashed assets (/_astro/*) being emitted after thefilesystemroute handle in.vercel/output/config.json.
-
π Patch Changes
- #17818
c0b6581Thanks @florian-lefebvre! - Updates the development image service to forward every argument it receives to Astroβs Sharp service, including the newloggerparameter
- #17818
π Patch Changes
- #17794
dd29ce8Thanks @astro-factory! - Fixes a bug where@vercel/nftfile tracing silently dropped all dependency files whenoutDirwas configured outsideroot, causing deployed functions to crash withERR_MODULE_NOT_FOUND
- #17794
π Patch Changes
-
#17687
0a22ff5Thanks @asmyshlyaev177! - FixesmiddlewareMode: 'edge'not running your middleware whenisris also enabledPreviously, enabling both options deployed the edge middleware but never reached it: requests went straight to the ISR function, which skips rendering entirely on a cache hit. Middleware now runs at the edge for ISR-backed routes before the cached response is served, and query strings are preserved when it forwards the request.
-
Updated dependencies [
05763a0]:- @astrojs/internal-helpers@0.10.4
-
π Patch Changes
-
#17680
ce9f1daThanks @astrobot-houston! - Fixes server islands returning 404 responses in Vercel deployments usingoutput: "static" -
Updated dependencies [
8c193f6]:- @astrojs/internal-helpers@0.10.3
-
π Patch Changes
- Updated dependencies [
c895b12]:- @astrojs/internal-helpers@0.10.2
- Updated dependencies [
π Patch Changes
- Updated dependencies [
eb6f97e]:- @astrojs/internal-helpers@0.10.1
- Updated dependencies [
π Patch Changes
- #17249
02b73b0Thanks @ematipico! - Fixes an issue where thepeerDependenciesfield used incorrect dependencies.
- #17249
β¨ Major Changes
πΏ Minor Changes
-
#16335
9a53f77Thanks @ascorbic! - Adds a CDN cache provider for Astro route caching on VercelSetup
Import
cacheVercel()from@astrojs/vercel/cacheand set it as your cache provider:import { defineConfig } from 'astro/config';import vercel from '@astrojs/vercel';import { cacheVercel } from '@astrojs/vercel/cache';export default defineConfig({adapter: vercel(),cache: {provider: cacheVercel(),},});Caching responses
Use
Astro.cache.set()in your pages and API routes to cache responses on Vercelβs edge network. The provider setsVercel-CDN-Cache-ControlandVercel-Cache-Tagheaders on responses.---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:
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:
src/pages/api/purge.ts export async function POST({ request, cache }) {await cache.invalidate({ tags: ['products'] });return new Response('Purged');}// Path-based invalidationawait 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
-
π Patch Changes
- Updated dependencies [
f732f3c]:- @astrojs/internal-helpers@0.10.0
- Updated dependencies [