-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 for adapter-cloudflare
#9617
Comments
Vercel has a #2963 looks quite related |
split
option for adapter-cloudflare
split
option for adapter-cloudflare
split
option for adapter-cloudflare
I believe the Cloudflare allows 5mb on the paid plans, which gives some more room. Still, being able to split the app would be amazing. I am not sure if it’s possible though. It seems that Cloudflare expects one _worker.js file: |
@jrf0110 do you know if this feature is possible to implement on Cloudflare Pages? |
Note that these limits (1MB free, 5MB paid) are after gzip compression. My SvelteKit app produces a 1.75MB I don't think it's possible to do auto splitting yet (see this ticket), but you can petition them on a case-by-case basis to raise the limit for you: https://forms.gle/ukpeZVLWLnKeixDu7 |
Another thing to add, and maybe this is something to control within Sveltekit: the content of my pre-rendered routes is also being added to the _worker.js file. Example, if I add a .md page to my route, while enabling pre-rendering, the content of this .md file ends up in the _worker.js file, even though the page is pre-rendered. Beyond the file size itself having a large _worker.js file will increase the worker startup time. Having all the raw text content of the website load on every worker invocation is not very effective. Any advice would be welcome. |
Soon :) cloudflare/workers-sdk#2769 |
Looks like cloudflare/workers-sdk#2769 has been merged and deployed. So does this now need to be incorporated into the adapter? |
closing in favour of #2963 |
Describe the problem
So it seems that sveltekit deploys the whole app (minus the static parts) as a single worker.js file. Cloudflare has a limit of 1mb for this file.
How does one structure an application that doesn't exceed 1mb in total?
Example, I am using markdown to store content in my project, which is imported using this code in +pager.server.ts:
const modules = import.meta.glob('../../markdown/**/*.md')
Unless I am doing something wrong it seems that the single worker.js file now includes all of the markdown files?
Related: #2963
Describe the proposed solution
I don't really know. Maybe a way for the adapter to scale to something larger?
Alternatives considered
I've looked at Vercel but I don't like the pricing, and cloudflare seems to offer more features.
Importance
i cannot use SvelteKit without it
Additional Information
No response
The text was updated successfully, but these errors were encountered: