hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francois-Xavier Bonnet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1190) "Vary: Cookie" header not working
Date Fri, 11 May 2012 17:44:53 GMT

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

Francois-Xavier Bonnet commented on HTTPCLIENT-1190:

I have seen that cookie header generation is done by org.apache.http.client.protocol.RequestAddCookies
I don't know what is the best way to make the changes to the request visible from the cache.
Even if HttpClient made these changes visible once the request is executed, the problem is
that we need these headers before to be able to lookup for the right variant key. Another
problem is that HttpRequestInterceptors are using the HttpContext and currently CacheKeyGenerator
does not know the HttpContext so we would have to make some big changes.

If you have some ideas about how we could design all that, I will be happy to try to make
a patch. I can see a quick fix using RequestAddCookies inside CacheKeyGenerator but this would
not be clean and it would work anly for Cookie header and we may have the same problem with
other HttpRequestInterceptors.

About the use of "Vary: Cookie" the idea is not to store private contents inside a shared
cache, it is more about being able to make some user profiles in your web site. Imagine that
you have 1000 users and you can split them into 3 different profiles and you want each profile
to see a different variant of the pages. If the cache is able to store the 3 variants and
serve them to the right users depending on their cookie value it can improve a lot the performance.
> "Vary: Cookie" header not working
> ---------------------------------
>                 Key: HTTPCLIENT-1190
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1190
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1.3, Snapshot
>            Reporter: Francois-Xavier Bonnet
> When using a CachingHttpClient with a target server that uses a cookie and "Vary: Cookie"
header in order to have different variants depending on the value of the cookie, there is
only one variant stored in the cache and sent whatever the value of the cookie.
> The problems comes from the cookie header that does not really exist in the request,
it is just created by the HttpClient while executing the request. As a result the variant
key is always "{cookie=}".

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