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

Francois-Xavier Bonnet commented on HTTPCLIENT-1290:
----------------------------------------------------

Jon, here is the detail of the headers I get on an Apache 2.2.22 with 
mod_expires and a static file.
The first request is an unconditional request, response has Last-Modified, 
Cache-Control and Expires headers.
The second request is a conditional request (my browser has the response in 
cache already), response has Cache-Control and Expires headers but no 
Last-modified.
Such a 304 response is cached by HttpClient but it can never be reused to serve 
a conditional request because of the Last-modified header missing so a 
revalidation occurs each time.


----------------------------------------------------------
GET /test.html HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 
Firefox/17.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en,en-us;q=0.8,fr;q=0.5,fr-fr;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: __utma=111872281.836020683.1357204249.1357204249.1357561311.2; 
__utmz=111872281.1357204249.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); 
__utmc=111872281

HTTP/1.1 200 OK
Date: Mon, 07 Jan 2013 14:39:13 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Mon, 07 Jan 2013 13:47:12 GMT
Etag: "140250-5-4d2b310f43c3e"
Accept-Ranges: bytes
Cache-Control: max-age=3600
Expires: Mon, 07 Jan 2013 15:39:13 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 25
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
----------------------------------------------------------
GET /test.html HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 
Firefox/17.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en,en-us;q=0.8,fr;q=0.5,fr-fr;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: __utma=111872281.836020683.1357204249.1357204249.1357561311.2; 
__utmz=111872281.1357204249.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); 
__utmc=111872281
If-Modified-Since: Mon, 07 Jan 2013 13:47:12 GMT
If-None-Match: "140250-5-4d2b310f43c3e"
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Date: Mon, 07 Jan 2013 14:39:42 GMT
Server: Apache/2.2.22 (Ubuntu)
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
Etag: "140250-5-4d2b310f43c3e"
Expires: Mon, 07 Jan 2013 15:39:42 GMT
Cache-Control: max-age=3600
Vary: Accept-Encoding
----------------------------------------------------------
                
> 304 cached response never reused with If-modified-since conditional requests
> ----------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1290
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1290
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2.3
>            Reporter: Francois-Xavier Bonnet
>         Attachments: HTTPCLIENT-1290.txt
>
>
> Steps to reproduce the problem:
> - cache is empty
> - send a conditional If-modified-since request
> - backend server responds with a 304 Not modified (the response does not 
> contain the "Last-modified" header, this conforms to rfc 2616 chapter 10.3.5)
> - the response is stored in the cache
> - send another conditional If-modified-since request
> - as the cache entry does not contain a Last-modified header to match with 
> the If-modified-since request header, the cache considers the entry cannot be 
> used and sends a request again to the backend server

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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