Warning-free build, cacheability refactor, and real-world sample (API + Redis + Polly) - #4
Merged
Merged
Conversation
…expression No behavior change — same status codes, same explicit-freshness guard for 404/405/410/414. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-compose Adds samples/ with a Kestrel origin API that drives caching purely through standard headers (Cache-Control, ETag, Vary, stale windows) and a client wiring the full recommended pipeline: AddStampedeHttp + UseDistributedCacheStore (Redis) + Polly resilience handler (retry with exponential backoff + timeout) chained below the coalescer. docker-compose runs Redis + the API + two client replicas to demonstrate the Redis-backed cache being shared across instances while coalescing stays per-process. Includes an outage drill (stop the API, watch stale-if-error shield callers) and a samples README documenting what to watch. Samples are intentionally not part of Stampede.Http.slnx so the main build and CI stay Docker-free. Validated end-to-end locally against real Kestrel + Redis: coalescing 10 -> 1, sub-millisecond Redis hits with Age, 304 revalidation, SWR background refresh, Polly retries on 503 bursts, POST invalidation shared across two client instances. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Three independent pieces of housekeeping and developer experience:
25b1621): resolves every xUnit analyzer warning in the test project (xUnit1051: useTestContext.Current.CancellationToken). The full solution now builds with 0 warnings, matching the repo's contribution rule.switchstatement inCachingMiddlewareto a switch expression. No behavior change — same status codes, same explicit-freshness guard for 404/405/410/414.samples/): a runnable deployment proving the full recommended pipeline against real infrastructure — Kestrel origin API + Redis-backedDistributedCacheStore+ Polly (retry with exponential backoff + timeout) chained below the coalescer, orchestrated with docker-compose running two client replicas.Why
samples/README.md).Reviewer notes
Stampede.Http.slnx, so CI and the normal dev loop stay Docker-free. They reference the library byProjectReference, so they always exercise current source.coalescing.deduplicated = 9), sub-millisecond Redis hits withAge, 304 conditional revalidation on expiry,stale-while-revalidatebackground refresh, Polly retries visible on 503 bursts, and aPOST /cataloginvalidation observed by both client instances through the shared store.docker compose up --buildimage builds themselves were not exercised (only localdotnet run+ a Redis container); a root.dockerignoreis included to keepbin/objout of the build context.Ageheader keeps growing instead of resetting (RFC 9111 §4.3.4 / §4.2.3). Tracked as a follow-up task.Test plan
dotnet build Stampede.Http.slnx -c Release→ 0 warnings, 0 errorsdotnet test Stampede.Http.Tests -c Release→ 343/343 passing🤖 Generated with Claude Code