ci(deploy): force no-cache on config.js to avoid edge-cache lag#20
Merged
Conversation
…deploys Tigris' edge serves bucket objects with a default 1-hour cache TTL. config.js carries deploy-time substitutions (WS URL, RPC URL, etc.) — a 1-hour stale window means users see the previous deploy's config for up to an hour, with no way to refresh besides Cache-Control bypass. Hit this directly on the v0.2.13 deploy: mainnet refreshed promptly, testnet served the pre-deploy config.js for ~1h because the edge cache was warm with the older object. After each `aws s3 sync`, run an extra `aws s3 cp public/config.js s3://<bucket>/config.js` that overwrites the object metadata with `cache-control: no-cache, max-age=0`. content-type is set explicitly to keep it `text/javascript` (s3 cp won't infer mime when the key has an existing object with overridden metadata). Other assets keep the bucket default — only config.js needs the no-cache treatment, because it's the only deploy-time-substituted artifact. Mirrored on the mainnet branch with the same change against the mainnet-network-dashboard bucket. Driven by wire-network-dashboard-to-platform-1.
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.
Summary
Tigris' edge serves bucket objects with a default 1-hour cache TTL.
config.jscarries deploy-time substitutions (WS URL, RPC URL, council platform URL, etc.) — a 1-hour stale window means users see the previous deploy's config for up to an hour after a redeploy, with no way to refresh besides aCache-Control: no-cachebypass.Hit this directly on the v0.2.13 deploy (PR #19): mainnet refreshed promptly because the edge cache happened to be cold, testnet served the pre-deploy config.js for ~1h because the edge cache was warm with the older object.
What ships
After each
aws s3 syncupload, run a targeted follow-up:This overwrites the object metadata with
cache-control: no-cache, max-age=0.content-typeis set explicitly totext/javascriptbecauseaws s3 cpdoesn't always infer the mime type when re-uploading an object with overridden metadata.Other bucket assets (app.js, app.js.map, styles.css, index.html, world-map.svg, health.json) keep the bucket default —
config.jsis the only deploy-time-substituted artifact that needs the no-cache treatment.Mirrored on both branches:
s3://network-dashboard/config.jss3://mainnet-network-dashboard/config.jsCommits
ci(deploy): force no-cache on config.js to avoid edge-cache lag on redeployschore: release v0.2.14Test plan
deno fmt --checkcleandeno lintcleandeno task checkcleandeno task test— 13 passeddeno task buildcleancurl -I https://dashboard-testnet.moonlightprotocol.io/config.jsshowscache-control: no-cache, max-age=0curl -I https://dashboard.moonlightprotocol.io/config.jsshowscache-control: no-cache, max-age=0curl -I https://dashboard.moonlightprotocol.io/app.jsstill showscache-control: public, max-age=3600(other assets unchanged)Driven by
/Users/theahaco/repos/pm-theahaco/prompts/wire-network-dashboard-to-platform-1-prompt.md.