Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MEAI docs: Caching #6246

Open
SteveSandersonMS opened this issue Apr 4, 2025 · 0 comments · May be fixed by #6256
Open

MEAI docs: Caching #6246

SteveSandersonMS opened this issue Apr 4, 2025 · 0 comments · May be fixed by #6256
Assignees
Labels
area-ai Microsoft.Extensions.AI libraries

Comments

@SteveSandersonMS
Copy link
Member

An outcome from TM review.

In docs for UseCache/UseDistributedCache:

  • This middleware doesn't guarantee that all data will be retained when responses are served from cache. Since we JSON-serialize everything for cache storage, we can only preserve things that round-trip through JSON.
  • For example RawResponse objects will usually not be preserved
  • Likewise, AdditionalProperties entries will usually be rehydrated as JsonElement values instead of whatever int/string/etc values they were originally

So altogether it's up to app developers to not rely on accessing data that can't be preserved through JSON serialization when using caching.

@SteveSandersonMS SteveSandersonMS added area-ai Microsoft.Extensions.AI libraries and removed area-caching-hybrid labels Apr 4, 2025
@stephentoub stephentoub self-assigned this Apr 7, 2025
@stephentoub stephentoub linked a pull request Apr 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ai Microsoft.Extensions.AI libraries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants