Astro 5.6 brings improved environment variables and session API support to Cloudflare
Web framework Astro has released version 5.6, introducing several new features and improvements. Notably, this update allows global access to environment variables in Cloudflare, aligning the Cloudflare adapter with other official adapters. This enhancement is due to updates in Cloudflare Workers, now integrated into Astro.
The release also simplifies the integration of the experimental Astro sessions API with Cloudflare by automatically configuring Cloudflare KV storage. This ensures reliable session data storage and access across Cloudflare's network.
Astro 5.6 introduces new prefetch eagerness controls, allowing developers to manage how aggressively links are prefetched or prerendered. Additionally, a new prerenderedErrorPageFetch option in the Adapter API enables custom implementations for fetching prerendered error pages.
The update includes a load() method for manually loading sessions by ID and config validation after each integration to help identify issues. There are also breaking changes to the experimental SVG API, alongside other improvements and bug fixes.
