Skip to content

ci(deploy): force no-cache on config.js to avoid edge-cache lag#20

Merged
AquiGorka merged 2 commits into
mainfrom
fix/config-js-cache-control
May 21, 2026
Merged

ci(deploy): force no-cache on config.js to avoid edge-cache lag#20
AquiGorka merged 2 commits into
mainfrom
fix/config-js-cache-control

Conversation

@AquiGorka
Copy link
Copy Markdown
Contributor

Summary

Tigris' edge serves bucket objects with a default 1-hour cache TTL. config.js carries 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 a Cache-Control: no-cache bypass.

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 sync upload, run a targeted follow-up:

aws s3 cp public/config.js s3://<bucket>/config.js \
  --endpoint-url https://fly.storage.tigris.dev \
  --acl public-read \
  --cache-control "no-cache, max-age=0" \
  --content-type text/javascript \
  --no-progress

This overwrites the object metadata with cache-control: no-cache, max-age=0. content-type is set explicitly to text/javascript because aws s3 cp doesn'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.js is the only deploy-time-substituted artifact that needs the no-cache treatment.

Mirrored on both branches:

  • testnet: s3://network-dashboard/config.js
  • mainnet: s3://mainnet-network-dashboard/config.js

Commits

  1. ci(deploy): force no-cache on config.js to avoid edge-cache lag on redeploys
  2. chore: release v0.2.14

Test plan

  • deno fmt --check clean
  • deno lint clean
  • deno task check clean
  • deno task test — 13 passed
  • deno task build clean
  • After merge: curl -I https://dashboard-testnet.moonlightprotocol.io/config.js shows cache-control: no-cache, max-age=0
  • After merge: curl -I https://dashboard.moonlightprotocol.io/config.js shows cache-control: no-cache, max-age=0
  • Spot-check curl -I https://dashboard.moonlightprotocol.io/app.js still shows cache-control: public, max-age=3600 (other assets unchanged)

Driven by /Users/theahaco/repos/pm-theahaco/prompts/wire-network-dashboard-to-platform-1-prompt.md.

AquiGorka added 2 commits May 21, 2026 13:25
…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.
@AquiGorka AquiGorka merged commit 1edb565 into main May 21, 2026
5 checks passed
@AquiGorka AquiGorka deleted the fix/config-js-cache-control branch May 21, 2026 16:36
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