hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alin Vasile (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1137) The values for the Via header are created by httpclient-cache for each cached and backend request
Date Wed, 02 Nov 2011 20:45:32 GMT

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

Alin Vasile commented on HTTPCLIENT-1137:

Hi Jon,

   Thanks for reviewing my patch.

   I wanted to keep the request operations thread safe, but if you think race conditions are
not a problem, I can use a simple map (my initial solution was a simple HashMap, as you suggest).
Do you think a ConcurrentHashMap would be more appropriate, so we don't have stale string
values? (I'm thinking that a different thread might see an incomplete Via value in this map
if we use a simple HashMap).

> The values for the Via header are created by httpclient-cache for each cached and backend
> -------------------------------------------------------------------------------------------------
>                 Key: HTTPCLIENT-1137
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1137
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1.2
>            Reporter: Alin Vasile
>            Priority: Trivial
>             Fix For: 4.2 Alpha2
>         Attachments: cached_via_header_vals.patch
> The Via header that gets generated and inserted by the caching layer is done repeatedly
in the HTTP conversation, even if the constructed string is constant for each protocol version
that is involved.
> The proposed patch constructs a map of generated values held in memory with the associated
ProtocolVersion as a key and uses read/write locks to access the data. This  solution minimizes
the time to generate such a value from several milliseconds to 40-50 microseconds.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message