Skip to content

Update Cloudflare imageService docs for custom image service support - #14095

Merged
matthewp merged 3 commits into
withastro:mainfrom
adamchal:docs/cloudflare-custom-image-service
Jul 1, 2026
Merged

Update Cloudflare imageService docs for custom image service support#14095
matthewp merged 3 commits into
withastro:mainfrom
adamchal:docs/cloudflare-custom-image-service

Conversation

@adamchal

Copy link
Copy Markdown
Contributor

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.

Description (required)

Two mode descriptions were out of date:

  • compile previously always used the adapter's internal workerd image service. It now uses the configured image.service if one is defined (running its custom getURL() and getHTMLAttributes() hooks while prerendering), and falls back to the internal dependencies only when no custom service is set.
  • custom previously ran only at runtime. It now also generates optimized image assets at build time for prerendered routes (the service's transform() hook runs at build), and Sharp is no longer bundled into the worker when the configured service does not need it.

The edits keep the existing bullet structure, reuse the existing Image Options link, and preserve the existing workerd runtime caveat on custom.

Related issues & labels (optional)

Discord username: adam.chal

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.
@astrobot-houston

astrobot-houston commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/integrations-guide/cloudflare.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@astrobot-houston

Copy link
Copy Markdown
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🥳.

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, and welcome. Sorry for the delay, with v7 release, I didn't have the chance to review this sooner!

I don't know if this is because I'm not familiar enough with Cloudflare but the lengthy explanations from the two PRs confused me a bit. I hope I got it right. 😄 Feel free to double check the accuracy of my suggestions!

What bothers me currently is that some elements look like implementation details (so, not helpful for the user), and it isn't really clear what falls under pre-rendering versus on-demand rendering.

Comment thread src/content/docs/en/guides/integrations-guide/cloudflare.mdx Outdated
Comment thread src/content/docs/en/guides/integrations-guide/cloudflare.mdx Outdated
@ArmandPhilippot ArmandPhilippot added the improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) label Jun 25, 2026
adamchal and others added 2 commits June 26, 2026 13:56
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@adamchal

Copy link
Copy Markdown
Contributor Author

@ArmandPhilippot thanks for the feedback! Read it through a dozen times to make sure that the essence of the PR changes are captured and properly reflected in your suggestions and they are. Really appreciate it!

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for double checking, and the updates! This looks good to me (what, am I biased? 😄 ). We can always add "Sharp is not compatible" later if someone complains!

@ArmandPhilippot ArmandPhilippot added the merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) label Jun 26, 2026
@matthewp
matthewp merged commit c713b1e into withastro:main Jul 1, 2026
9 checks passed
@adamchal
adamchal deleted the docs/cloudflare-custom-image-service branch July 1, 2026 22:21
isyuah pushed a commit to isyuah/astro-docs that referenced this pull request Jul 2, 2026
withastro#14095)

Co-authored-by: Armand Philippot <git@armand.philippot.eu>
tarikrital pushed a commit to tarikrital/astro-docs that referenced this pull request Jul 6, 2026
withastro#14095)

Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants