-
Notifications
You must be signed in to change notification settings - Fork 192
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
feat: Change getCacheKey implementation for more unique keys #560
Conversation
6ccea31
to
126d7ec
Compare
126d7ec
to
4317d4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! I think we can improve a few things. Additionally, I'd like to see PHPDoc comments for the getCacheKey
method which explains which fields are included in the cache key.
a0dc04d
to
8415d95
Compare
@westarle We are looking to merge this soon, and would love you to take a look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits and minor suggestions only!
return ($this->imdsv2SessionTokenUrl ?? '') . | ||
'.' . ($this->securityCredentialsUrl ?? '') . | ||
'.' . $this->regionUrl . | ||
'.' . $this->regionalCredVerificationUrl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had a thought... one way you could get rid of the .
without having a separate function is to do something like this:
return implode('.', array_filter([
$this->imdsv2SessionTokenUrl,
$this->securityCredentialsUrl,
$this->regionUrl,
$this->regionalCredVerificationUrl
]));
But I don't think that's necessary... what we have here looks LGTM to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brent, you a genius, I do like that better haha.
We made changes to how we calculate the
cacheKeys
in order to avoid collision for the oncoming support for the Caching update.closes: #559