- Add concurrent rendering support for `experimental.incrementalBuild` when using `@astrojs/cloudflare`
- Add a Cloudflare `finalize()` response handler for custom request handlers to apply cookies and Cloudflare CDN cache defaults
- Incremental builds no longer disable caching when `build.concurrency` is greater than `1`
- Cloudflare builds reduce serialization overhead for large prerendered pages
- The `@astrojs/cloudflare/hono` middleware applies response headers automatically
- Cloudflare custom entrypoints fall back to static assets when no Astro route matches
- Cloudflare custom entrypoints use the default server entrypoint when prerendering through workerd
- Fix cold `astro dev` crashes by adding `astro/app/manifest` and `@astrojs/cloudflare/cache/provider` to the `optimizeDeps.include` list
From Astro
Minor Changes
-
#17795
15e2debThanks @matthewp! - Adds concurrent rendering support forexperimental.incrementalBuild, including when using@astrojs/cloudflareIncremental builds no longer disable caching when
build.concurrencyis greater than1. Projects that setbuild.concurrency: 1to keep the cache enabled can remove that workaround. Cloudflare builds also reduce serialization overhead for large prerendered pages. -
#17887
35aa62eThanks @matthewp! - Adds a Cloudflarefinalize()response handler for custom request handlersCall
finalize()to apply cookies and Cloudflare CDN cache defaults to the response from anastro/fetchpipeline:import { astro, FetchState } from 'astro/fetch'; import { cf, finalize } from '@astrojs/cloudflare/fetch'; export default { async fetch(request: Request, env: Env, context: ExecutionContext) { const state = new FetchState(request); const asset = await cf(state, env, context); if (asset) return asset; return finalize(state, await astro(state)); }, };The
@astrojs/cloudflare/honomiddleware applies these response headers automatically. Cloudflare custom entrypoints also fall back to static assets when no Astro route matches and use the default server entrypoint when prerendering through workerd.
Patch Changes
-
#17895
41b88acThanks @astro-factory! - Fixes coldastro devcrashes by addingastro/app/manifestand@astrojs/cloudflare/cache/providerto theoptimizeDeps.includelist -
Updated dependencies []:
- @astrojs/underscore-redirects@1.0.4