fix(api): /healthz Cache-Control: no-store (BUG-API-300)#192
Merged
Conversation
/healthz is the rule-14 build-SHA gate surface. Without a Cache-Control
directive, intermediaries (CF edge, browser fetch cache, NR synthetic,
kubectl-port-forward'd browser tab) may return a stale commit_id for
seconds-to-minutes after a rollout, silently breaking the "did the new
image actually land" verification.
Stamp `Cache-Control: no-store` so probes always hit the live pod.
Coverage block:
Symptom: /healthz returns identical JSON every call (BUG-API-300)
Enumeration: rg -F '/healthz' internal/router/router.go (1 emit)
Sites found: 1 (router.go:414)
Sites touched: 1
Coverage test: TestHealthzShape pins Cache-Control: no-store header so
a future deletion of c.Set(HeaderCacheControl, "no-store")
fails before merge.
Live verified: pending auto-deploy + curl https://api.instanode.dev/healthz
-I | grep -i cache-control
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mastermanas805
added a commit
that referenced
this pull request
May 30, 2026
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
Cache-Control, intermediaries (CF edge, browser fetch cache, NR synthetic) may return a stalecommit_idfor seconds-to-minutes after a rollout — silently breaking the "did the new image actually land" verification.Cache-Control: no-storeso probes always hit the live pod.Coverage block
Inbox reference
Test plan
go build ./...cleango vet ./...cleango test ./internal/router/ -short -count=1greencurl -I https://api.instanode.dev/healthz | grep -i cache-controlreturnscache-control: no-storeafter auto-deploycurl https://api.instanode.dev/healthz | jq -r .commit_idmatches the merge SHA🤖 Generated with Claude Code