Skip to content

MemoryCache: obsolete API removed in 3.0 #14772

Closed
@JamesNK

Description

@JamesNK

MemoryCache: obsolete API removed in 3.0

This is a follow up to aspnet/Caching#221. The 3.0 release will remove the obsolete MemoryCacheOptions APIs.

Discussion: dotnet/extensions#1062.

Version introduced

3.0

Old behavior

MemoryCacheOptions.CompactOnMemoryPressure property was available.

New behavior

MemoryCacheOptions.CompactOnMemoryPressure has been removed.

Reason for change

Automatically compacting the cache caused problems. We recommend compacting the cache when needed to avoid unexpected behavior.

Recommended action

To compact, downcast to MemoryCache and call Compact when needed.

Category

  • ASP.NET Core

Affected APIs

MemoryCacheOptions.CompactOnMemoryPressure


Issue metadata

  • Issue type: breaking-change

Metadata

Metadata

Assignees

Labels

breaking-changeIndicates a .NET Core breaking change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions