[
https://issues.apache.org/jira/browse/HTTPCLIENT-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862929#action_12862929
]
Sebb commented on HTTPCLIENT-427:
---------------------------------
The volatile long count fields in CachingHttpClient are not guaranteed to be
updated correctly by multiple threads.
This is because:
* increment is not atomic
* long read/write are not guaranteed atomic (though they probably are on most
modern hardware)
The first could cause lost updates, the second could cause rubbish values to be
stored.
Could either use AtomicLong, or could synchronize updates.
> Implement a cache to perform real request only when needed
> ----------------------------------------------------------
>
> Key: HTTPCLIENT-427
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-427
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpClient
> Environment: Operating System: Linux
> Platform: PC
> Reporter: Marc Guillemot
> Fix For: 4.1 Alpha2
>
> Attachments: caching_client.zip, httpclient-cache.zip
>
>
> Browsers may cache received content according to the values of different
> response headers. It would be great if HttpClient could do the same.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]