Repository navigation
RFC: QUERY method transport for server$ (RFC 10008) — deferred follow-up to #358 #359
maiieul
started this conversation in
Proposals For Qwik
Replies: 0 comments
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.
The problem: the missing quadrant
HTTP never had a method for "a read with a big input". RFC 10008
(June 2026) fixes that with
QUERY:Reads whose input doesn't fit a URL — faceted-search filter objects, vector/embedding arrays,
"fetch these 200 ids", GraphQL-ish queries — are forced into POST today, losing caching, dedupe,
and safe retry.
What Qwik has today
server$(fn, { method: 'GET' })already exists: args serialize into aqdata=search param andthe function can set
cacheControl()— cacheable, safe reads for small args. This is exactlythe "GET equivalence" escape hatch h3 ships in h3#1448.
URL alone, because the SSR document request is a GET (URL-as-state contract). The gap is
server$reads only.flowchart TD R["server read with arguments"] --> S{"args fit in a URL?"} S -- "yes" --> G["server$ method: 'GET'<br/>exists today — cacheable, safe"] S -- "no" --> M{"mutation?"} M -- "yes" --> P["server$ POST — correct"] M -- "no, a read" --> Q["server$ method: 'QUERY'<br/>this RFC — the missing quadrant"]Proposal (later, small)
A pure addition, because #358 (§5.3) pins server-function error handling as method-agnostic:
QUERYwith the serialized-args body (same code path as POST;fetch()permitsthe method).
QUERY.QUERYto the CSRF origin-check list — it carries a body; "safe" doesn't exemptit (fail closed).
Error semantics inherit from #358 unchanged:
PublicError→ 200 envelope +no-store; unexpected→ 500 generic. Success responses may carry real cache headers — that's where QUERY earns its
keep. Bonus: safe + idempotent makes every retry path legitimate (async-computed
invalidate()/poll/expires, proxies, service workers) — none of which is kosher against POST.Why deferred
RFC 10008 is weeks old. Browsers can send QUERY, but browser HTTP caches and CDNs don't cache
it yet (body-digest cache keys are new machinery), and some proxies will 405 it. Until infra
catches up, QUERY ≈ POST in practice; the GET mode we already ship is the part that caches today.
h3 hedges the same way (its
QUERYhandler optionally serves a GET twin). Waiting costs zerocode thanks to the method-agnostic invariant.
Decisions for the meeting
server$(fn, { method: 'QUERY' })(proposed) vs a dedicatedquery$()twin?POST? (Silent downgrade changes cache semantics; propose no.)
major CDN announces QUERY caching (or h3/Nitro ship it stable and demand shows up).
All reactions