-
-
Notifications
You must be signed in to change notification settings - Fork 7
Added support for custom cache key provider #10
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
Conversation
Nice idea. I gonna have a review asap. |
/azp run |
No pipelines are associated with this pull request. |
@steuic I added some unit tests. Can you please have a look at the test ShouldGetKey_WithoutMatchingHeader. I think something is going wrong there. The current output key is |
/azp run |
No pipelines are associated with this pull request. |
@steuic you can check the latest pre-release nuget. Your change should be part of it. |
Thank you Thomas.
👍
…________________________________
From: Thomas Galliker ***@***.***>
Sent: Saturday, May 7, 2022 1:06:53 PM
To: thomasgalliker/HttpClient.Caching ***@***.***>
Cc: steuic ***@***.***>; Mention ***@***.***>
Subject: Re: [thomasgalliker/HttpClient.Caching] Added support for custom cache key provider (PR #10)
@steuic<https://github.com/steuic> you can check the latest pre-release nuget. Your change should be part of it.
—
Reply to this email directly, view it on GitHub<#10 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIAQBQYFBHOVZQPK3XEPNULVIZFE3ANCNFSM5M2OJ3PA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
InMemoryCacheHandler now supports custom cache key provider.
Custom cache key provider and already implemented cache key providers
Interface
ICacheKeysProvider
allow to implement custom cache key providers.Provider
DefaultCacheKeysProvider
provides cache key by concatenation of http method (GET or HEAD) and uri.Provider
MethodUriHeadersCacheKeysProvider
provides cache key by concatenation of http method (GET or HEAD), specific http headers and uri.Backward compatibility
When no custom cache key provider is specified, InMemoryCacheHandler will use
DefaultCacheKeysProvider
which resemble previous cache key composition strategy: concatenation of http method (GET or HEAD) and uri. This allow backward compatibility.