[
https://issues.apache.org/jira/browse/HTTPCLIENT-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861417#action_12861417
]
Oleg Kalnichevski commented on HTTPCLIENT-427:
----------------------------------------------
> How do I go about contributing to the tutorial?
Ideally, by submitting a patch. The latest tutorial snapshot in the DocBook
format can be found here:
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/src/docbkx/
I took a _very_ cursory look at the code. Overall, great stuff. Some minor
remarks:
(1) I spotted quite a few instance variables that could be made final. Final
variables make code somewhat less prone to race conditions and generally make
it easier to ensure thread-safety when accessed by multiple threads.
(2) Static Logs are considered harmful in managed environments such as JEE
containers. HttpClient uses non-static Log instances as recommended by the
developers of Commons Logging. Cache should be consistent with the rest of the
code base.
(3) I see lots of places where CacheOperationExceptions are silently discarded.
Each particular case should be reviewed and the exception should either be
propagated, handled or logged. Exceptions should be ignored in very special
cases only. In most cases logging at DEBUG or WARN priority is all that it
takes.
(4) Ideally CacheEntry class should not impose a particular physical
representation of the cache entry content (for instance, as a byte array). We
might also want to provide a file system based cache implementation, which
ideally should function without buffering the entire response content in
memory. I kind of think CacheEntry might even use HttpEntity interface for
content representation.
There are two ways we could proceed. (1) I can commit the patch pretty much as
is and let you work on improvements incrementally by submitting smaller
patches, or (2) you can resubmit the whole thing if that is easier for you.
Cheers
Oleg
> 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
>
>
> 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]