Skip to content

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jun 3, 2025

@conico974 what do you think about this PR?

When investigating perf issue with https://github.com/LubomirGeorgiev/cloudflare-workers-nextjs-saas-template, I measure the preload to be 200-300ms.

This change could save some CPU cycles.

Copy link

changeset-bot bot commented Jun 3, 2025

🦋 Changeset detected

Latest commit: 16417c4

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

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Minor

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

Copy link

pkg-pr-new bot commented Jun 3, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@696

commit: 16417c4

@vicb vicb requested a review from conico974 June 3, 2025 12:45
Copy link
Collaborator

@conico974 conico974 left a comment

Choose a reason for hiding this comment

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

Yeah i think it's a quick fix, but ideally, we should move the preload in the waitUntil after the request is done. This way we'll barely consume any cpu cycle from the current request and really execute everything in the background.
It should be done in AWS though

@vicb vicb mentioned this pull request Jun 4, 2025
@vicb
Copy link
Contributor Author

vicb commented Jun 5, 2025

Thanks for the reviews!

@vicb vicb merged commit de6a6cd into main Jun 5, 2025
7 checks passed
@vicb vicb deleted the vicb/preload branch June 5, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants