[316] Set tiered Cache-Control on published dashboard objects - #349
Draft
CarsonDavis wants to merge 1 commit into
Draft
[316] Set tiered Cache-Control on published dashboard objects#349CarsonDavis wants to merge 1 commit into
CarsonDavis wants to merge 1 commit into
Conversation
CarsonDavis
force-pushed
the
316-republish-stack-convergence
branch
from
August 27, 2026 16:30
60c6db9 to
6bb5bf6
Compare
CarsonDavis
force-pushed
the
316-dashboard-cache-control
branch
from
August 27, 2026 16:36
185c147 to
7d8b397
Compare
CarsonDavis
force-pushed
the
316-republish-stack-convergence
branch
from
August 27, 2026 18:08
6bb5bf6 to
1f719bb
Compare
A republish has to show up immediately through a fronting cache we cannot invalidate — ours or a customer's CloudFront — so every object now carries a Cache-Control chosen by its key: the entry page and the baked config revalidate before every use, the keys that are content- addressed by construction are immutable, and everything else gets a short 5-minute TTL. Two key classes earn the immutable tier. The webpack output under build/static/(js|css|media) is content-hashed — a premise now pinned by tests/unit/webpackHashedOutput.spec.js, which fails if a production naming option loses its hash. The plugin uploads under assets/<mission>/<subdir>/uploads/ are named crypto.randomUUID() by the upload router and never overwritten, so their keys are content-addressed too. The S3 copy paths (copyPrefix, copyObjectIfExists) also switch to MetadataDirective REPLACE, since CopyObject's default COPY preserves the source's metadata verbatim and cannot set a header the source object never had. REPLACE means supplying ContentType too, taken from the same extension map the uploads use.
CarsonDavis
force-pushed
the
316-dashboard-cache-control
branch
from
August 27, 2026 18:15
7d8b397 to
f0af5d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #316 — PR 3 of 3, stacked on #348 (which stacks on #330). Retarget to
developmentas the stack merges; the close fires when this final piece lands.Uploads dashboard objects with tiered
Cache-Controlheaders so fronting caches (ours and a customer's CloudFront) show republishes immediately, with no purge on the customer's side.no-cache; the content-hashed bundle and the never-reused uploaded assets are long-lived immutable; everything else is short-lived. A new test pins the webpack config to content-hashed output names so nothing un-hashed can drift into the immutable tier. OnecacheControlForKeyhelper, table-driven tests.MetadataDirective: REPLACEwith correctContentTypeandCacheControl, which previously carried no Cache-Control at all. Tradeoff:REPLACEre-derivesContentTypefrom the key's extension instead of preserving the source object's header — equivalent for every type that flows through these paths today (upload images and the demo CSV are all in the extension map).serving-a-dashboard-from-your-domain.md, which this PR makes true.Verification: 1615 unit tests green.