hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Moore (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1290) 304 cached response never reused with If-modified-since conditional requests
Date Mon, 07 Jan 2013 11:44:14 GMT

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

Jon Moore commented on HTTPCLIENT-1290:
---------------------------------------

Actually, in particular, see 13.4 of RFC 2616:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4

"A response received with a status code of 200, 203, 206, 300, 301 or 410 MAY be stored by
a cache and used in reply to a subsequent request, subject to the expiration mechanism, unless
a cache-control directive prohibits caching. However, a cache that does not support the Range
and Content-Range headers MUST NOT cache 206 (Partial Content) responses.

A response received with any other status code (e.g. status codes 302 and 307) MUST NOT be
returned in a reply to a subsequent request unless there are cache-control directives or another
header(s) that explicitly allow it. For example, these include the following: an Expires header
(section 14.21); a "max-age", "s-maxage", "must- revalidate", "proxy-revalidate", "public"
or "private" cache-control directive (section 14.9)."

So I think the headers on the first 304 response from the origin are critical to the discussion.

                
> 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
>
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message