You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to have persistent cache, application developer supposed to implement this interface.
BeforeCacheAccess method supposed to read persistent state of the cache and deserialize it to MSAL in-memory cache.
AfterCacheAccess method supposed to serialize in-memory MSAL cache and write it to persistent storage.
Implementation is supposed to handle concurrent access to the persistent storage.
In general case, cross-process lock should be acquired in beforeCacheAccess method and release it in afterCacheAccess method.
BUT if wrapped MSAL cache access logic is "read access", lock should be released in BeforeCacheAccess method in order to avoid lock starvation.
Another way to optimize cache read operations is to trek version of persisted cache state to avoid unnecessary lock acquisitions.
Majority of cache operation is reads, so optimizing it is crucial.