Problem
When no backend is configured, @cache / AppCache register a MemoryBackend silently (get_backend_or_fallback). Under uvicorn --workers N or gunicorn, each process then has its own cache. An invalidation from a write reaches one worker, and the other workers keep serving the old value until it expires:
PUT /products/1 -> price 1.0
GET /products/1 -> alternates between 1.0 and 9.99 across workers
BACKENDS.md mentions this once; at runtime the fallback is logged only at DEBUG.
Proposal
Log a WARNING (once per process) when the memory fallback is registered implicitly. It should say that the cache is per process and name BackendProxy.set(...). An explicit BackendProxy.set(MemoryBackend()) stays silent.
Problem
When no backend is configured,
@cache/AppCacheregister aMemoryBackendsilently (get_backend_or_fallback). Underuvicorn --workers Nor gunicorn, each process then has its own cache. An invalidation from a write reaches one worker, and the other workers keep serving the old value until it expires:BACKENDS.md mentions this once; at runtime the fallback is logged only at
DEBUG.Proposal
Log a
WARNING(once per process) when the memory fallback is registered implicitly. It should say that the cache is per process and nameBackendProxy.set(...). An explicitBackendProxy.set(MemoryBackend())stays silent.