Add cache key identity note to middleware docs

This commit is contained in:
Jeremiah Lowin 2026-02-16 08:52:28 -05:00
commit 62804e2f06
No known key found for this signature in database

View file

@ -431,6 +431,10 @@ mcp.add_middleware(ResponseCachingMiddleware(
See [Storage Backends](/servers/storage-backends) for complete options.
<Note>
Cache keys are based on the operation name and arguments only — they do not include user or session identity. If your tools return user-specific data derived from auth context (e.g., headers or session state) rather than from the request arguments, you should either disable caching for those tools or ensure user identity is part of the tool arguments.
</Note>
### Rate Limiting
```python