-
Notifications
You must be signed in to change notification settings - Fork 16
Customize cache key generation #30
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
Comments
👍 |
👍
Maybe... or we put that functionality in another class. |
Maybe... or we put that functionality in another class.
also thought about that, but the drawback is that the cache key
generator will notice when things are missing / not good to do a cache
key and could abort. but yeah, there is the risk of abusing this to just
decide on cacheability of a request...
|
I agree with @Nyholm, it's a separate responsibility. The CacheKeyGenerator can throw an exception though which can result in cacheability to be impossible, but that decision needs to be made elsewhere. Actually I forsee that we are going to move the entire caching stuff to the message package and just wrap it in the plugin. Not sure if it makes sense, but we are putting tons of effort into it, would be nice to see if the caching logic can be used elsewhere or not. |
Actual Behavior
The cache key is currently generated based on the following details:
Expected Behavior
One should be able to customize this behaviour.
Example: Separate cache entry per authorization header.
Possible Solutions
Introduce a
CacheKeyGenerator
interface which would receive the request as a parameter.It should be an optional parameter of the plugin, falling back to the current implementation.
The text was updated successfully, but these errors were encountered: