W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2009

RE: BNF for Cache-Control

From: Brian Smith <brian@briansmith.org>
Date: Sun, 24 May 2009 05:11:15 -0500
To: "'Julian Reschke'" <julian.reschke@gmx.de>, "'Adrien de Croy'" <adrien@qbik.com>
Cc: "'HTTP Working Group'" <ietf-http-wg@w3.org>
Message-ID: <000001c9dc57$fc86d4d0$f5947e70$@org>
Julian Reschke wrote:
> Adrien de Croy wrote:
> > Is this intended?  Surely cache-response-directive are only valid for
> > responses, and cache-request-directive for requests?
> >
> > I would have expected something more like:
> >
> >    Cache-Control = "Cache-Control" ":" cache-control-request |
> >                    cache-control-response
> >    cache-control-request = 1#cache-request-directive
> >    cache-control-response = 1#cache-response-directive
> >
> > to enforce separation.
> >
> > Apologies if this is already covered in HTTPbis
> > ...
> 
> There's a limit to what we can (or *want*) express in the ABNF.
> 
> If we made that change, a header instance that combined both request
> and response directives would by syntactically invalid. Would that
> reflect what's really desired and implemented? Shouldn't recipients
> just ignore those directives they don't understand?

A parser using the current grammar will never recognize anything as a
cache-response-directive, because cache-response-directive comes after
cache-request-directive, and cache-request-directive matches all
cache-response-directives, because of its cache-extension alternative. (The
RFC3986 grammar uses a "first-match-wins" parsing rule. Since the HTTP
grammar reuses some of these "first-match-wins" productions, I'm assuming
that the HTTP grammar also requires "first-match-wins" parsing throughout.
Otherwise, it would be ambiguous in at least a few places.)

A grammar like Adrien's suggested is definitely clearer than the current
one. The specification would be even clearer (and, importantly, without
grammar ambiguity) if it treated Cache-Control as separate request- and
response- headers, instead of a single header with two different syntaxes.
That is probably something best looked at after the grammar changes in the
way Julian mentioned a few days ago (looking up the syntax based on the name
of the header).

- Brian
Received on Sunday, 24 May 2009 10:11:58 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 2 February 2023 18:43:19 UTC