W3C home > Mailing lists > Public > www-validator@w3.org > November 2007

Re: Something about the caching feature in 0.9.x

From: Nikita The Spider The Spider <nikitathespider@gmail.com>
Date: Thu, 15 Nov 2007 10:57:44 -0500
Message-ID: <35e76ac10711150757j3b3850c8hc732b68f64c66b3c@mail.gmail.com>
To: "Karim A." <directeur@gmail.com>
Cc: "W3C Validator Community" <www-validator@w3.org>

On Nov 15, 2007 9:47 AM, Karim A. <directeur@gmail.com> wrote:
>
> I read here: http://validator.w3.org/todo.html
> that in the 0.9.x series you'll start using Last-Modified
> to cache validation results and request again only
> if-modified-since.
>
> I'm very interested in that since the release of
> our humble project http://xhtml-css.com
> and I struggle with some say chaching "standards".
> Not all servers provide "Last-Modified", some provide
> "etag", other servers nothing and some others both![1]

Hi Karim,
Providing both is valid. According to the HTTP 1.1 spec, "[T]he
preferred behavior for an HTTP/1.1 origin server is to send both a
strong entity tag and a Last-Modified value."
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.4

A server may also legitimately not send any cache information if it
doesn't want its responses to be cached. When no cache information is
sent, a strictly-complying user agent must assume that what it has in
its cache is stale. In this case the UA can still use what is in its
cache ("A client MAY also specify that it will accept stale
responses...") and some browsers do so very aggresively to improve
performance.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.1.6

> The best, of course, will be to use Last-Modified
> and etag, but I'm not sure how reliable they are.

Good news -- it isn't your job to decide how reliable they are. If the
server sends out this information, your user agent must respect it or
be in violation of RFC 2616. If the information looks odd (e.g. a
Last-Modified date of 1 second ago along with an ETag that's the same
as the one you saw one month ago), that's the business of the server
admin. Caching is complicated enough without trying to second-guess
what the server sends out. =)

Good luck

-- 
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
Received on Thursday, 15 November 2007 16:07:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:27 GMT