Request‑Scoped Caching in FastAPI Dependency Injection: When and How to Use Sub‑Dependencies
Learn how FastAPI caches dependencies per request, shares sub‑dependency instances, and lets you swap them in tests without touching production data.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how FastAPI caches dependencies per request, shares sub‑dependency instances, and lets you swap them in tests without touching production data.
Goal is to clarify request-scoped storage cleanup and state isolation guarantees for Fiber v3 applications running with Prefork enabled and custom middleware that references App-level state. The configuration transition from single-process to Prefork changes the process model and initialization semantics compared with the default single-process mode. Fiber v