-
Notifications
You must be signed in to change notification settings - Fork 241
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 our terms of service and privacy 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?
Conversation
|
Potential Issues for Adopting Services
|
|
Agree with @jmprieur, it is a large behavioral change, can this be an opt-in behavior? |
Without eviction policies, we're just trading "static dictionary with predictable growth" for "MemoryCache with unpredictable growth...not an improvement, just a different problem |
MSAL static cachePros: fast MemoryCachePros: app developer can set eviction policies If we do opt-in, how would that setting look like? |
b195b50 to
5d43327
Compare
|
@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. |
|
+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. |
|
[like] Jean-Marc Prieur reacted to your message:
…________________________________
From: Peter ***@***.***>
Sent: Saturday, October 11, 2025 7:03:25 AM
To: 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: ***@***.***>
|
5d43327 to
3fb8503
Compare
See #3237