-
Notifications
You must be signed in to change notification settings - Fork 31
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: LRU cache key #504
feat: LRU cache key #504
Conversation
dae254f
to
3c8f8c1
Compare
Ok, the change is easy enough, but I wonder if there was a reason to hash it before storing it in the cache in the first place. The main thing I can think of is security, but the cache is in memory, so I'm not sure that's a valid assumption. Also, is avoiding the hashing really faster? I wouldn't expect the hashing to really slow down the whole thing. |
I did the same question to myself and wasn't able to find the proper answer. The hashing part btw makes it a bit slower. We should understand what's the right balance. |
I would not do this change until we discover why it was done in this way in the first place, and unless benchmarks show that it's much faster to do it without hashing the token. |
I was thinking about giving the option to pass a hasher. |
d593490
to
aa23c18
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.
Can you please expand the caching section to mention the performance implication of the default cache key builder and what to do to improve performance (i.e. use the identity function)?
Co-authored-by: Simone Busoli <simone.busoli@gmail.com>
Closes #503