Repository navigation
Invalidate the run history in its own step, under the path CloudFront caches - #18
Merged
Merged
Conversation
… caches PerfSummarize invalidated /api/runs/history, but PerfRouter's viewer request function rewrites that to /runs/history before CloudFront looks in its cache, so the cached copy is keyed by /runs/history and an edge kept serving the history from before the run. CloudFront's docs say to invalidate both the viewer's path and the rewritten one. PerfRun now ends with an Invalidate step, CloudFront's CreateInvalidation through the Step Functions SDK integration, for both paths. PerfSummarize only stores the summary, and drops @aws-sdk/client-cloudfront. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdeTv4n6b1zDWzb9yofdbN
NimmLor
marked this pull request as ready for review
November 2, 2026 13:43
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.
PerfSummarize invalidated
/api/runs/historyafter each run, and the invalidations completed, but edges kept serving the history from before the run (X-Cache: Hit,Age: 1037, after an invalidation had completed).PerfRouter's viewer request function (SST's Router) rewrites
/api/runs/historyto/runs/historybefore CloudFront looks in its cache, so the cached copy is keyed by/runs/history. CloudFront's docs say to invalidate both the viewer's path and the rewritten one.Invalidatestep: CloudFrontCreateInvalidationthrough the Step Functions SDK integration, for/api/runs/historyand/runs/history, with retries.PERF_DISTRIBUTION, and the repo drops@aws-sdk/client-cloudfront.scripts/perf-summarize.tsno longer invalidates anything, so a backfill shows up once the cached copy expires or the next run invalidates it.Checks:
bun run typecheck,bun lint --max-warnings 0(canary),bun fmt --check,bun testall pass. Not deployed: after deploying, start a run and check that/api/runs/historyreturns it from an edge that had it cached.Generated by Claude Code