- Notifications
You must be signed in to change notification settings - Fork242
Use MemoryCache instead of static cache in MSAL#3543
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
jmprieur commentedOct 10, 2025
jmprieur commentedOct 10, 2025
Potential Issues for Adopting Services
|
keegan-caruso commentedOct 10, 2025
Agree with@jmprieur, it is a large behavioral change, can this be an opt-in behavior? |
jennyf19 commentedOct 10, 2025
Without eviction policies, we're just trading "static dictionary with predictable growth" for "MemoryCache with unpredictable growth...not an improvement, just a different problem |
bgavrilMS commentedOct 10, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
MSAL static cachePros: fast MemoryCachePros: app developer can set eviction policies If we do opt-in, how would that setting look like? |
jmprieur commentedOct 10, 2025
@bgavrilMS : the recommendation from the MISE team is to add a new boolean in the MicrosoftIdentityApplicationOptions or one of its base classes to specify if to use the static cache or not. An opt-in to use an evictable but slower in-memory cache, making this PR no longer a breaking change. |
pmaytak commentedOct 11, 2025
+1 to making this an opt-in change via options. In my experience, different users value different things (cache size vs speed). Setting and changing the default will make someone unhappy. Another point is that when we make big changes like this, even in major versions, it reduces the SDK maintainability a bit. For example, when users have issues, it'll add time to figure out which SDK version has which cache and such. So maybe for now if we keep static cache as default but make it clear on how to change it if size becomes an issue. |
jmprieur commentedOct 11, 2025 via email
[like] Jean-Marc Prieur reacted to your message: …________________________________From: Peter ***@***.***>Sent: Saturday, October 11, 2025 7:03:25 AMTo: AzureAD/microsoft-identity-web ***@***.***>Cc: Jean-Marc Prieur ***@***.***>; Mention ***@***.***>Subject: Re: [AzureAD/microsoft-identity-web] Use MemoryCache instead of static cache in MSAL (PR#3543)[https://avatars.githubusercontent.com/u/34331512?s=20&v=4]pmaytak left a comment (AzureAD/microsoft-identity-web#3543)<#3543 (comment)>+1 to making this an opt-in change via options. In my experience, different users value different things (cache size vs speed). Setting and changing the default will make someone unhappy. Another point is that when we make big changes like this, even in major versions, it reduces the SDK maintainability a bit. For example, when users have issues, it'll add time to figure out which SDK version has which cache and such. So maybe for now if we keep static cache as default but make it clear on how to change it if size becomes an issue.—Reply to this email directly, view it on GitHub<#3543 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADEXN5F2YW2BYBJVK7IAW6D3XCTT3AVCNFSM6AAAAACIZEQXJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGOJTGAYDGNBUGQ>.You are receiving this because you were mentioned.Message ID: ***@***.***> |
Uh oh!
There was an error while loading.Please reload this page.
See#3237