Re: Content-Length and 304

It seems like a CL of 0 (or anything other than the actual representation’s
length) is just wrong.  I suggest language to the effect of “The
Content-length value, if provided, MUST be accurate”.  I.e. if the server
chooses not to provide the correct answer, it should not send the header.
Or is there a case for a reserved value of -1 meaning “Not provided”?

I have to say that I don’t understand the motivation for encouraging
Content-length with 304 at all; that’s another argument, but I think we can
agree that it should either be accurate or absent.

FWIW, when I was making my living writing large-scale Web spiders, I
quickly learned to just treat Content-length as science fiction, suck it up
and deal with whatever data the server actually sent. But that was a decade
ago; maybe things are better now.

-Tim

On Thu, Sep 20, 2012 at 10:27 AM, Mark Nottingham <mnot@mnot.net> wrote:

> My experience has always been that the C-L on a 304 represents the length
> of the response had it been whole, and I see that as just a clarification
> of current practice.
>
> However, I agree that the SHOULD is too strong here, as it makes several
> existing implementations non-conformant.
>
> Cheers,
>
>
> On 20/09/2012, at 2:46 AM, Julian Reschke <julian.reschke@gmx.de> wrote:
>
> > On 2012-09-20 03:22, Zhong Yu wrote:
> >> In the latest bis draft, a 304 response SHOULD set Content-Length
> >> equal to the length of the would-be payload body.
> >> ...
> >
> > That was the case since -19 (just clarifying).
> >
> > I also note that the requirements in P1 (Content-Length) and P4 (status
> code 304) do not seem to be totally in sync.
> >
> > Best regards, Julian
> >
>
> --
> Mark Nottingham
> http://www.mnot.net/
>
>
>
>
>
>

Received on Thursday, 20 September 2012 17:38:45 UTC