hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Berlin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCLIENT-427) Implement a cache to perform real request only when needed
Date Fri, 07 May 2010 13:02:50 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865134#action_12865134
] 

Sam Berlin commented on HTTPCLIENT-427:
---------------------------------------

One statement, one question:

1) Without looking at the code involved, the AtomicLong variable would only need to be volatile
if the variable itself were being assigned to a new AtomicLong in one thread and used in another.
 If the AtomicLong object is created & assigned in one place (preferably the constructor,
allowing the object to be final), then calling 'set' or 'get' on it is effectively the same
as calling get or set on a volatile long.  If you say 'new AtomicLong' somewhere other than
the constructor, something is probably wrong with the code.

2) Re: the byte[].clone() that sebb added.  Again I haven't looked too deeply at the code
(just the diffs), but is that the byte[] of the body of a cached response?  If so, that could
potentially be very large.  Cloning it could lead to memory crunches.  Is it possible to change
the objects involved to ByteBuffers & convert it using asReadOnly?  Additionally, if it
is a byte[] of the body of cached response... I'm concerned that larger responses (ie, downloading
a large file) wouldn't even be able to be stored in memory.  Does the API allow for reading
the data from an InputStream (or Channel?).  (If that byte[] is not for the body of cached
responses, you can ignore this question.)

> 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-427-Immutable-CacheEntry2.patch,
HTTPCLIENT-427-immutable-cachenentry.patch, 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message