@astrojs/cloudflare@14.0.0
📦 astroView on GitHub →
✨ 4 features🐛 2 fixes🔧 5 symbols
Summary
This release upgrades Astro to Vite v8 and introduces an opt-in CDN cache provider for Cloudflare Workers, significantly enhancing caching capabilities for supported deployments. Several performance improvements and cleanup of deprecated warnings were also included.
Migration Steps
- If using the new Cloudflare CDN cache provider, import `cacheCloudflare` from `@astrojs/cloudflare/cache` and configure it in your `cache` setting in `astro.config.js`.
- If using the Cloudflare adapter with the new cache provider, note that calling `cache.invalidate()` will throw an error if the Cloudflare Cache feature is not accessible (e.g., without private beta access).
✨ New Features
- Upgrade to Vite v8.
- Adds an opt-in CDN cache provider for Astro route caching on Cloudflare Workers, requiring import of `cacheCloudflare()` and configuration in `astro.config.js`.
- Cloudflare cache provider allows setting cache control headers (`Cloudflare-CDN-Cache-Control` and `Cache-Tag`) via `Astro.cache.set()` or `routeRules` configuration.
- Supports cache invalidation by tag or path from API routes using `cache.invalidate()`.
🐛 Bug Fixes
- Speeds up `astro sync` by no longer starting the Cloudflare runtime during type generation.
- Removes deprecations warnings added in Astro v6 for Cloudflare specific Astro.locals properties.