From 4c191c9102b8702b3dc37daf97ca65fd5a002fa6 Mon Sep 17 00:00:00 2001 From: Adam Chalemian Date: Thu, 18 Jun 2026 16:20:59 -0400 Subject: [PATCH] Update Cloudflare `imageService` docs for custom image service support Clarify that `compile` mode uses a configured custom `image.service` when defined (running its `getURL()`/`getHTMLAttributes()` hooks during prerendering), and that `custom` mode now also generates optimized assets at build time via the service's `transform()` hook, without bundling Sharp when it is not needed. See withastro/astro#17099. --- src/content/docs/en/guides/integrations-guide/cloudflare.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/en/guides/integrations-guide/cloudflare.mdx b/src/content/docs/en/guides/integrations-guide/cloudflare.mdx index e663d1a1971aa..fe300a862dd20 100644 --- a/src/content/docs/en/guides/integrations-guide/cloudflare.mdx +++ b/src/content/docs/en/guides/integrations-guide/cloudflare.mdx @@ -125,8 +125,8 @@ Determines which image service is used by the adapter. The adapter will default - **`cloudflare`:** Uses the [Cloudflare Image Resizing](https://developers.cloudflare.com/images/image-resizing/) service. - **`cloudflare-binding`:** Uses the [Cloudflare Images binding](https://developers.cloudflare.com/images/transform-images/bindings/) for image transformation. The binding is automatically provisioned when you deploy. - **`passthrough`:** Uses the existing [`noop`](/en/guides/images/#configure-no-op-passthrough-service) service. -- **`compile`:** Uses a combination of internal dependencies to transform images locally at build time for prerendered routes. The noop `passthrough` option is configured for on-demand rendered pages. -- **`custom`:** Always uses the image service configured in [Image Options](/en/reference/configuration-reference/#image-options). **This option will not check to see whether the configured image service works in Cloudflare's `workerd` runtime.** +- **`compile`:** Uses the image service configured in [Image Options](/en/reference/configuration-reference/#image-options) if one is defined, running its custom `getURL()` and `getHTMLAttributes()` hooks while prerendering. Otherwise, it uses a combination of internal dependencies to transform images locally at build time for prerendered routes. The noop `passthrough` option is configured for on-demand rendered pages. +- **`custom`:** Always uses the image service configured in [Image Options](/en/reference/configuration-reference/#image-options), both for runtime image handling and for build-time asset generation for prerendered routes, where its `transform()` hook runs at build time. Sharp is not bundled into the worker when the configured service does not require it. **This option will not check to see whether the configured image service works in Cloudflare's `workerd` runtime.** It is also possible to configure your image service as an object, setting both a build time and runtime service independently. Currently, `'compile'` is the only available build-time option. The supported runtime options are `'passthrough'` (default) and `'cloudflare-binding'`: