Why the background task in RevalidatingServerAuthenticationStateProvider? #49177
Unanswered
DavidThielen
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Does #12909 shed some light into why it's done this way? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why wasn't RevalidatingServerAuthenticationStateProvider implemented as an override of GetAuthenticationStateAsync() where it has a LastValidated DateTime and compares that to DateTime.UtcNow to eighter return the stored authenticationStateTask or hit the DB to read in the latest?
I understand that this approach eliminates a call to DateTime.UtcNow on each call to GetAuthenticationStateAsync() but that's not an expensive call and GetAuthenticationStateAsync() is called just once for each new page being rendered.
Is there another reason for this approach? Or is it to improve every bit of performance everywhere (which is a good thing)?
thanks - dave
Beta Was this translation helpful? Give feedback.
All reactions