Skip to content

Support caching HTTP QUERY (RFC 10008) responses, keyed on the request body #6849

Open

Description

@jeswr

RFC 10008 defines QUERY — a safe, idempotent, cacheable HTTP method carrying a request body whose content defines the query. Per §2.7, a QUERY response is cacheable and the cache key MUST incorporate the request content (not just method + URL + Vary).

Today the Cache API (caches.default, Cache.match() / Cache.put()) is GET-oriented and does not cache QUERY responses keyed on the request body, so a Worker cannot serve a QUERY result from cache — which is the main advantage of QUERY over POST-as-read.

Ask: support caching QUERY responses with a key derived from the request body (+ Content-Type) per §2.7 — e.g. allow QUERY in Cache.match() / Cache.put() with the request body folded into the key (buffering it before key computation, with a size cap and a cache-bypass fallback for unbuffered bodies). The managed edge cache is the natural follow-on; the Cache API contract is the piece workerd owns.

Context: RFC 10008 was co-authored by a Cloudflare engineer (James M. Snell), so there is likely natural interest here. A reference implementation of a body-aware QUERY cache key exists in Node's undici (nodejs/undici), and server-side support is emerging (Eclipse Jetty, Apache Tomcat).


Part of a broader RFC 10008 adoption effort: https://github.com/jeswr/http-query-adoption

Activity

  1. Utsav7428 commented on Jul 3, 2026

    @Utsav7428

    Hi team,

    I’d love to take a swing at implementing this. I’ve read the contribution guidelines and know that workerd prioritizes internal architecture, so I wanted to propose a high-level approach and get your blessing on the design before I start writing any C++.

    Given that @jasnell co-authored RFC 10008, I'm hoping this aligns well with Cloudflare's broader vision.

  2. Utsav7428 commented on Jul 4, 2026

    @Utsav7428

    I have implemented the initial phase of support for the HTTP QUERY method (RFC 10008) as discussed. You can track the progress in the following PR:

    PR: #6857
    Scope: Phase 1 & 2 (API boundary, routing, and telemetry).
    Status: Draft (ready for architectural review).

    I am now beginning the investigation for Phase 3 (Request body streaming). Feedback on the current PR is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions