Skip to content

fix: set cache-control on authenticated JSON responses (#2425)#1

Open
Karry2019web wants to merge 1 commit into
mainfrom
fix/cache-control-auth-json-2425
Open

fix: set cache-control on authenticated JSON responses (#2425)#1
Karry2019web wants to merge 1 commit into
mainfrom
fix/cache-control-auth-json-2425

Conversation

@Karry2019web
Copy link
Copy Markdown
Owner

Closes orchestration-agent#2425

/claim orchestration-agent#2425

Summary

  • Add that sets on authenticated JSON responses
  • Apply the middleware decision before downstream handlers (body parsing, rate-limiting) to avoid unnecessary work
  • Add , , and to authenticated JSON responses
  • Clean up request-local state in block to prevent cross-request leaks
  • Non-authenticated requests and non-JSON responses are left untouched
  • Export from so existing test imports work

Test Plan

  • -> 19 passed
  • Covers: bearer auth, cookie auth, JSON detection, non-JSON passthrough, unauthenticated bypass, Vary deduplication, exception path cleanup, end-to-end integration with the full FastAPI stack

…-agent#2425)

- Add CacheControlMiddleware that sets Cache-Control: no-store on authenticated JSON responses
- Apply to both Bearer token and session-cookie authenticated requests
- Cover success (200), error (4xx/5xx), and exception paths without leaking state
- Registered in the middleware stack before RateLimit and Logging

Closes orchestration-agent#2425
@Karry2019web Karry2019web force-pushed the fix/cache-control-auth-json-2425 branch from 1a8f158 to 76223a0 Compare May 22, 2026 16:00
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.

[ Bounty $10k ] [ Middleware ] Set cache-control on authenticated JSON responses — cache middleware

1 participant