Conversation
JamesNK
reviewed
Apr 2, 2021
| .SetSize(1).SetSlidingExpiration(_options.CacheEntryExpiration).SetAbsoluteExpiration(certificate.NotAfter)); | ||
| { | ||
| // Cache expired certs for little while too | ||
| var absExpiration = (certificate.NotAfter < DateTime.Now) ? DateTime.Now + _options.CacheEntryExpiration : certificate.NotAfter; |
Member
There was a problem hiding this comment.
Is NotAfter a UTC or local time? Change to DateTime.UtcNow if it is UTC, or add a comment that it is local and that DateTime.Now usage is intentional.
Member
Author
There was a problem hiding this comment.
NotAfter is local time, so I'll add a comment, will look to see if its easy to add a unit test
Contributor
Member
Author
|
This PR doesn't have anything to do with the tests failures, its just a performance fix in one scenario, it won't have any functional impact its just follow up to some perf issues we saw from the benchmarks when we had an expired cert |
Contributor
|
@HaoK should this be closed give it's almost a year old? |
Member
Author
|
No I will get this in during 7.0, i just need to add some tests |
Member
Author
|
Actually looks like this fix was already contained in d5a337c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We saw massive performance hits in the benchmark when we were using an expired cert, due to the validation cache not storing expired certs at all.
Cache expired certs for 2 minutes by default should mitigate this