public final class IfModifiedSince extends HeaderDate
Allows a 304 Not Modified to be returned if content is unchanged.
If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
If-Modified-Since = "If-Modified-Since" ":" HTTP-date
An example of the field is:
If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
A GET method with an If-Modified-Since header and no Range header requests that the identified entity be transferred only if it has been modified since the date given by the If-Modified-Since header. The algorithm for determining this includes the following cases:
The purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction overhead.
Note: The Range request-header field modifies the meaning of If-Modified-Since; see section 14.35 for full details.
Note: If-Modified-Since times are interpreted by the server, whose clock might not be synchronized with the client.
Note: When handling an If-Modified-Since header field, some servers will use an exact date comparison function, rather than a less-than function, for deciding whether to send a 304 (Not Modified) response. To get best results when sending an If-Modified-Since header field for cache validation, clients are advised to use the exact date string received in a previous Last-Modified header field whenever possible.
Note: If a client uses an arbitrary date in the If-Modified-Since header instead of a date taken from the Last-Modified header for the same request, the client should be aware of the fact that this date is interpreted in the server's understanding of time. The client should consider unsynchronized clocks and rounding problems due to the different encodings of time between the client and server. This includes the possibility of race conditions if the document has changed between the time it was first requested and the If-Modified-Since date of a subsequent request, and the possibility of clock-skew-related problems if the If-Modified-Since date is derived from the client's clock without correction to the server's clock. Corrections for different time bases between client and server are at best approximate due to network latency. The result of a request having both an If-Modified-Since header field and either an If-Match or an If-Unmodified-Since header fields is undefined by this specification.
Modifier and Type | Method and Description |
---|---|
static IfModifiedSince |
forString(String value)
Returns a parsed
If-Modified-Since header. |
asDate, toString
public static IfModifiedSince forString(String value)
If-Modified-Since
header.value
- The If-Modified-Since
header string.If-Modified-Since
header, or Copyright © 2018 Apache. All rights reserved.