Skip to content

[Feature Request] Static cache auto-cleanup #5660

@bgavrilMS

Description

@bgavrilMS

MSAL client type

Confidential

Problem statement

With the introduction of new features such as FMI, more and more access tokens are scoped by additional parameters. This puts pressure on MSAL's static cache.

A simple solution to deal with this is to walk through the static cache and remove expired access tokens. This should only be done when the static cache is used. Something like:

  • if there are more than N tokens in the cache (say N=10000)
  • lock the cache
  • remove expired tokens
  • unlock the cache

Alternatively, we can take a dependency (direct or via source code copy) on MemoryCache to replace our static cache. This can easily be done for S2S, where the cache key is known upfront.

Proposed solution

No response

Alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Committed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions