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

split option in cloudflare-adapter #8249

Closed
LoaiDev opened this issue Dec 22, 2022 · 2 comments
Closed

split option in cloudflare-adapter #8249

LoaiDev opened this issue Dec 22, 2022 · 2 comments

Comments

@LoaiDev
Copy link

LoaiDev commented Dec 22, 2022

Describe the problem

it would be beneficial to have the option to split routes ito individual functions just like the split function in vercel-adapter. This would have the advantage that static files and pre rendered pages wouldn't be handled by a function but with cloudflare directly using less quota. I don't know if it will affect performace in any way.

Describe the proposed solution

have a split option to the adapter just like the vercel adapter to create individual routes

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

@LoaiDev LoaiDev changed the title split option split option in cloudflare-adapter Dec 22, 2022
@samuba
Copy link

samuba commented Jan 4, 2023

Another huge benefit: You can get around the 1MB file size limit for workers.
Right now it is impossible to deploy to cloudflare if you have e.g. a route with a heavy dependency

@Rich-Harris
Copy link
Member

Unfortunately Cloudflare Pages just doesn't work that way AFAIK. You can split your functions up, but as soon as you deploy them they will get bundled back into a single worker.

As for static files and prerendered pages, they can in theory be included in _routes.json (support for which was added in #6530), but there's a limit to the number of entries you can have in that file and there was a concern about including everything, so some things have to be served via a function. @jrf0110 would know more!

@Rich-Harris Rich-Harris closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants