Skip to content

Make 'immutable' cache-control value HTTP/3 QPACK compatible #149

Open

Description

@naz

At the moment passing an immutable: true option adds an immutable value to the Cache-Control header. Ideally the header would be put as a separate Cache-Control header entry making such request QPACK-compatible.

Note: When evaluating the use of immutable and QPACK: If you're concerned that immutable changes the predefined value provided by QPACK, consider that in this case, the immutable part can be encoded separately by splitting the Cache-Control value into two lines — though this is dependent on the encoding algorithm a particular QPACK implementation uses.
(MDN reference)

Activity

  1. dougwilson commented on Sep 23, 2022

    @dougwilson
    Contributor

    I like it 👍 . Not sure if there are any implications to cache software in handing multiple header or not, but I don't think it would matter since cache-control is optimistic anyway if an intermediary just looked at the first cache-control header only.

  2. bilashcse commented on Aug 12, 2026

    @bilashcse

    The immutable option is handled by send, which builds the whole Cache-Control value there, so the change has to land in that module. I opened pillarjs/send#315 for it.

    With that patch, immutable: true results in two field-lines instead of one combined value, which leaves public, max-age=<seconds> matchable against the QPACK static table. Repeated Cache-Control field-lines are combined by caches, so the effective directives are unchanged. It ships with tests that assert the exact rawHeaders that go on the wire and a README note; lint plus Node.js 18-25 on ubuntu and windows all pass.

    Once it is released, serve-static picks it up through its send dependency with no code change needed here.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions