Skip to content

Cache-Control on error responses and custom headers status filter (v3) - #10

Open
frenzzy wants to merge 2 commits into
static-web-server:masterfrom
frenzzy:cache-control-status
Open

frenzzy wants to merge 2 commits into
static-web-server:masterfrom
frenzzy:cache-control-status

Conversation

@frenzzy

@frenzzy frenzzy commented Sep 28, 2026 •

Copy link
Copy Markdown

Description

v3 docs for two pending changes from static-web-server/static-web-server#756, one commit each:

  • cache-control-headers.md: an "Error responses" note after the file type lists. The file type max-age values apply only to 2xx and 304 responses; other file responses (e.g. a 404 for a missing asset) get no-cache. With a fallback page, a missing file is served as a 200 and still gets the file type value. Code change: Apply file type Cache-Control only to 2xx and 304 responses static-web-server#757.
  • custom-http-headers.md: the optional status key of [[advanced.headers]] entries, the responses that custom headers never reach (redirects, 405, maintenance mode), why 304 belongs in the list, the fallback page caveat, and an example of an unfiltered entry overridden by a filtered one. Code change: Optional status filter for custom headers static-web-server#758.

Please merge this only together with (or after) those PRs; each commit can be dropped if its PR is not accepted.

markdownlint-cli2 and prettier --check pass on the changed files.

Document that the file type `max-age` values of `--cache-control-headers`
apply only to successful and `304 Not Modified` responses, that other file
responses such as a `404` get `no-cache`, and that a fallback page response
is a `200` and still gets the file type value.
@frenzzy
frenzzy force-pushed the cache-control-status branch from 9cbfb2b to 85d609a Compare September 28, 2026 03:40
Describe the optional `status` key of `[[advanced.headers]]` entries, the
responses custom headers never reach, the fallback page caveat and how a
filtered entry overrides an earlier unfiltered one.
@frenzzy
frenzzy force-pushed the cache-control-status branch from 85d609a to 37107fb Compare September 28, 2026 04:42

This branch has not been deployed

No deployments
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.

1 participant