You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Arturo Bernal (Jira)" <ji...@apache.org> on 2023/05/07 06:41:00 UTC
[jira] [Commented] (HTTPCLIENT-1725) Heuristic caching does not work for URIs with a query string
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17720283#comment-17720283 ]
Arturo Bernal commented on HTTPCLIENT-1725:
-------------------------------------------
@[~olegk]
can be close [https://github.com/apache/httpcomponents-client/pull/417]
> Heuristic caching does not work for URIs with a query string
> ------------------------------------------------------------
>
> Key: HTTPCLIENT-1725
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1725
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCache
> Affects Versions: 4.5.1
> Reporter: Charlie Halford
> Priority: Major
> Labels: stuck, volunteers-wanted
> Fix For: Stuck
>
> Attachments: HTTPCLIENT-1725_add_query_string_caching.diff
>
>
> When enabling heuristic caching and setting a default lifetime, the responses from the server I am requesting from are not being stored in the cache.
> In org.apache.http.impl.client.cache.ResponseCachingPolicy, line 250 determines if the URI contains a query string:
> {code}
> request.getRequestLine().getUri().contains("?")
> {code}
> A few lines below, it then checks to see if the response contains cache headers:
> {code}
> else if (!isExplicitlyCacheable(response))
> {code}
> As I am attempting to cache a response that I know does not contain cache headers, the response should succeed in being cached. However, it fails the isExplictlyCachable() check, and thus returns false to the overall isResponseCachable() method. The isExplicitlyCachable() method is checked later on in the stack, so perhaps it can be safely removed here?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org