Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image optimization #106

Open
vicb opened this issue Oct 15, 2024 · 3 comments
Open

Image optimization #106

vicb opened this issue Oct 15, 2024 · 3 comments

Comments

@vicb
Copy link
Contributor

vicb commented Oct 15, 2024

Support Image Optimization on the cloudflare infra

Refs:

@vicb vicb converted this from a draft issue Oct 15, 2024
@conico974
Copy link

The aws implementation would probably not work as is on cloudflare ( It uses next and sharp ).

I had some plan to update the image optimization stuff to be more flexible.
The idea would be to replace the current next/sharp implementation with a custom override ( default would stay as is )

It would also make sense to change the way we install native deps. Right now for the image optimization it runs npm i sharp for the desired arch/target.
The idea would be to make this more generic so that you could choose for every part what you'd like to install and for which arch/target.
An option for every function in open-next.config.ts (server/middleware/imageOptimization ... ) in this form would make sense :

install : {
 packages: ['sharp', ...],
 arch: 'arm'|'x64',
}

Obviously for cloudflare you'll override the default with what's appropriate depending on what end up being decided here

@khalil-omer
Copy link

Shouldn't the implementation of image optimization simply use Cloudflare Images? This can be done manually, but maybe it can also be done after the base build is complete, via the Cloudflare build.

@vicb
Copy link
Contributor Author

vicb commented Oct 30, 2024

Shouldn't the implementation of image optimization simply use Cloudflare Images?

Yes that's the plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants