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

Jon Moore commented on HTTPCLIENT-1190:
---------------------------------------

Yes, this is a similar problem to HTTPCLIENT-1164, where DefaultHttpClient 
makes changes to the requests that affect caching and which the cache never 
sees. I think the proper solution to this is to extract cookie handling into a 
decorator as well, so that the cache can be wired up in-between that decorator 
and the rest of the request-issuing machinery. We'll have to take a look at 
what the default behavior for DefaultHttpClient is with respect to cookie 
handling, so that we can preserve that behavior while allowing the cache to be 
wired in properly.

As a side note, using "Vary: Cookie" with a shared cache, while allowed by the 
spec, is generally frowned upon (many popular stand-alone caches will simply 
refuse to cache these responses at all). You may be better off setting 
"Cache-Control: private" and installing client-side caches further upstream, 
since that's really what you're trying to accomplish. Of course, if you don't 
have control over the origin, then nevermind. Regardless, this is still a bug 
that should get fixed.

                
> "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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to