Class CachedHttpSessionValidator
Decorator over HttpUserSessionValidator that caches positive and negative session-active results for 30 s to avoid a cross-service HTTP call on every authenticated request.
public sealed class CachedHttpSessionValidator : IUserSessionValidator
- Inheritance
-
objectCachedHttpSessionValidator
- Implements
-
IUserSessionValidator
Constructors
CachedHttpSessionValidator(HttpUserSessionValidator, IMemoryCache)
public CachedHttpSessionValidator(HttpUserSessionValidator inner, IMemoryCache cache)
Parameters
innerHttpUserSessionValidatorcacheIMemoryCache
Methods
IsActiveAsync(Guid, CancellationToken)
public Task<bool> IsActiveAsync(Guid sessionId, CancellationToken ct = default)
Parameters
sessionIdGuidctCancellationToken
Returns
- Task<bool>