You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2018. It is now read-only.
There doesn't seem to be enough information on the Context to even create a custom CacheKeyStrategy. Is it possible to add some of the request information onto the Context?
The text was updated successfully, but these errors were encountered:
@ymor Before placing the call through HttpClient, you can use this extension method on HttpRequestMessage to set the Polly.Context to use with the request.
That example assumes your CachePolicy is using the default cache key strategy. If you use a custom cache key strategy you can vary the Context you pass to request.SetPolicyExecutionContext(...); to fit your custom strategy.
I have added some initial notes here in Polly's doco around IHttpClientFactory and Polly CachePolicy. The doco notes some considerations around caching at the low level of the raw HttpResponseMessage.
Thanks for contacting us. We believe that the question you've raised have been answered. If you still feel a need to continue the discussion, feel free to reopen it and add your comments.
The DefaultCacheKeyStrategy uses the ExecutionKey from the Polly Context. However this seems to never get set and so the Polly CacheEngineAsync never tries the cache.
There doesn't seem to be enough information on the Context to even create a custom CacheKeyStrategy. Is it possible to add some of the request information onto the Context?
The text was updated successfully, but these errors were encountered: