form-state Server Action fires on every field change — causes excessive requests on Cloudflare Workers #16044
Unanswered
dunkeyyfong
asked this question in
Q&A
Replies: 1 comment
-
|
I am getting unrelated emails.How can I unsubscribe? It's like too
much.please,guide me.
…On Tue, 24 Mar 2026, 08:41 Fong, ***@***.***> wrote:
form-state Server Action fires on every field change — causes excessive
requests on Cloudflare Workers Context
I'm running Payload CMS v3 on Cloudflare Workers using
@opennextjs/cloudflare. When editing any document in the Admin UI, I
noticed that every time a user types in a field, a POST request is fired
to /admin/collections/{slug}/create (or /edit) with the following payload:
[
{
"name": "form-state",
"args": {
"skipValidation": true,
"updateLastEdited": true,
"renderAllFields": false,
...
}
}
]
I understand this is by design — Payload v3 uses Server Actions (
handleServerFunctions) to rebuild form state on the server on every
onChange event, as documented here:
-
https://deepwiki.com/payloadcms/payload/4.3-form-state-management#updating-form-state-during-editing
- Source: packages/ui/src/views/Edit/index.tsx:447-489
Problem
On *Cloudflare Workers*, each of these form-state Server Action calls
counts as a separate invocation/subrequest. With a form that has multiple
fields and a user actively editing, this causes:
1. *Excessive Worker invocations* — even with the existing 250ms
debounce, a user editing a form for 30 seconds can easily generate 50–100+
requests
2. *Potential hit on Cloudflare's subrequest limits* (50 on free plan,
1000 on paid)
3. *Increased latency* — each form-state call on Workers is slower
than on Node.js due to cold starts and the Workers runtime overhead
This is also related to #14656
<#14656>, where Server
Actions on Cloudflare Workers have authentication/context issues.
Question
Is there any plan to:
1. Make the onChange debounce configurable so deployments on
resource-constrained runtimes (like Cloudflare Workers) can increase it?
2. Provide an option to reduce or batch form-state calls?
3. Or is there a recommended workaround for Payload on Workers
specifically?
I know the form state system already has some optimizations (renderAllFields:
false, skipValidation, AbortController) but the sheer frequency of server
round-trips is problematic in a Workers environment.
Environment
- payload: v3.x
- next: 15.x
- @opennextjs/cloudflare: latest
- Runtime: Cloudflare Workers
- Database: (D1 / PostgreSQL)
References
- DeepWiki - Form State Management:
https://deepwiki.com/payloadcms/payload/4.3-form-state-management
- Related issue #14656
<#14656>: #14656
<#14656>
- Cloudflare Workers subrequest limits:
https://developers.cloudflare.com/workers/platform/limits/
—
Reply to this email directly, view it on GitHub
<#16044?email_source=notifications&email_token=AQOB6WZDGWRKAJPDWPSGPOL4SH4GXA5CNFSNUABAM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPHE3TGNJVGA3KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQOB6W5B6CYYP6F4TXDC75D4SH4GXAVCNFSM6AAAAACW44PIPKVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZZG4ZTKNJQGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
form-state Server Action fires on every field change — causes excessive requests on Cloudflare Workers
Context
I'm running Payload CMS v3 on Cloudflare Workers using
@opennextjs/cloudflare. When editing any document in the Admin UI, I noticed that every time a user types in a field, aPOSTrequest is fired to/admin/collections/{slug}/create(or/edit) with the following payload:[ { "name": "form-state", "args": { "skipValidation": true, "updateLastEdited": true, "renderAllFields": false, ... } } ]I understand this is by design — Payload v3 uses Server Actions (
handleServerFunctions) to rebuild form state on the server on everyonChangeevent, as documented here:packages/ui/src/views/Edit/index.tsx:447-489Problem
On Cloudflare Workers, each of these
form-stateServer Action calls counts as a separate invocation/subrequest. With a form that has multiple fields and a user actively editing, this causes:form-statecall on Workers is slower than on Node.js due to cold starts and the Workers runtime overheadThis is also related to #14656, where Server Actions on Cloudflare Workers have authentication/context issues.
Question
Is there any plan to:
onChangedebounce configurable so deployments on resource-constrained runtimes (like Cloudflare Workers) can increase it?form-statecalls?I know the form state system already has some optimizations (
renderAllFields: false,skipValidation, AbortController) but the sheer frequency of server round-trips is problematic in a Workers environment.Environment
payload: v3.xnext: 15.x@opennextjs/cloudflare: latestReferences
Beta Was this translation helpful? Give feedback.
All reactions