Astro: @astrojs/[email protected] Release

Release date:
June 22, 2026
Previous version:
@astrojs/[email protected] (released June 13, 2026)
Magnitude:
1,870 Diff Delta
Contributors:
11 total committers
Data confidence:
Commits:

46 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored June 15, 2026
Authored June 10, 2026
Authored June 15, 2026
Authored June 15, 2026
Authored June 11, 2026
Authored June 15, 2026
Authored June 10, 2026
Authored June 10, 2026
Authored June 22, 2026
Authored June 12, 2026
Authored June 17, 2026
Authored June 10, 2026

Top Contributors in @astrojs/[email protected]

matthewp
ascorbic
iseraph-dev
ematipico
Princesseuh
astrobot-houston
adamchal
ljharb
alexanderdombroski
ArmandPhilippot

Directory Browser for @astrojs/[email protected]

All files are compared to previous version, @astrojs/[email protected]. Click here to browse diffs between other versions.

Loading File Browser...

Release Notes Published

Major Changes

Minor Changes

  • #16335 9a53f77 Thanks @ascorbic! - Adds a CDN cache provider for Astro route caching on Vercel

    Setup

    Import cacheVercel() from @astrojs/vercel/cache and 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 sets Vercel-CDN-Cache-Control and Vercel-Cache-Tag headers 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 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