ok2c commented on code in PR #840:
URL:
https://github.com/apache/httpcomponents-client/pull/840#discussion_r3494345227
##########
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheKeyGenerator.java:
##########
@@ -192,13 +216,56 @@ public String generateKey(final URI requestUri) {
*/
public String generateKey(final HttpHost host, final HttpRequest request) {
final String s = getRequestUri(host, request);
+ final String hash = Method.QUERY.isSame(request.getMethod()) ?
getBodyHash(request) : null;
try {
- return generateKey(new URI(s));
+ return generateKey(new URI(s), hash);
} catch (final URISyntaxException ex) {
return s;
}
}
+ private static byte[] getRequestBodyBytes(final HttpRequest request) {
Review Comment:
@desiderantes I do not think this is how we should be doing it. This is not
going to work well with the async caching layer. We will likely need to extend
or to replace `CacheKeyGenerator` interface in order to solve the problem
properly.
As far as I understand QUERY method caching is not a hard requirement.
Please remove caching logic from the change-set for now. It can be introduced
at a later point with a separate pull request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]