Skip to content

MEAI docs: Caching #6246

Closed
Closed
@SteveSandersonMS

Description

@SteveSandersonMS

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.

Metadata

Metadata

Assignees

Labels

area-aiMicrosoft.Extensions.AI libraries

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions