Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Conversation

@ekwoka
Copy link

@ekwoka ekwoka commented Jan 28, 2025

Changes

  • Adds onerror=redirect to Cloudflare image transform params. This will allow images to continue to work after hitting Cloudflare's free limit. (docs)

I am not positive how this impacts sites that don't have the image service set up at all, since it might then load the original image as opposed to just erroring and loading nothing as it does now. If it still applies when the image service is disabled entirely, and shows the underlying image, it could cause some confusion with users not realizing the service isn't turned on.

Testing

None. It's a hardcoded value, and I more want to introduce the idea to see if this should be a configurable value, or just always applied.

Docs

This might be worth mentioning in the docs. I can make a PR to those once this is decided on.

Should this be a configurable? Currently there aren't configurations to the options, though maybe it could work with the Image to offer it if that is the preferred out.

@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2025

🦋 Changeset detected

Latest commit: ee60f0a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@astrojs/cloudflare Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-wasm Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-routes-json Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ekwoka ekwoka changed the title feature: Enables Cloudflare images onerror redirect feat(cloudflare): Enables image service onerror redirect Jan 28, 2025
@alexanderniebuhr alexanderniebuhr self-requested a review January 28, 2025 16:37
@ematipico
Copy link
Member

Hi, we moved the cloudflare adapter in a new repository: https://github.com/withastro/astro/tree/main/packages/integrations/cloudflare

We will achieve this repository soon, so if you wish to land this PR, you'll have to create a new one.

@ematipico ematipico closed this Feb 7, 2025
@ekwoka
Copy link
Author

ekwoka commented Feb 9, 2025

Awesome :sigh:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants