Handling duplicate headers

Felix felix at seconddrawer.com.au
Sat Apr 17 07:51:57 CEST 2010


I am using Chromium 5.0.342.9 on Linux and I am only referring to the
headers display while running varnishlog -c -o ReqStart ...

For a forced refresh Ctrl+F5 I get the following:

Chromium (5.0.342.9):

13 RxHeader     c User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2
13 RxHeader     c Cache-Control: max-age=0
13 RxHeader     c Pragma: no-cache
13 RxHeader     c Cache-Control: no-cache

Firefox (3.6.3):

13 RxHeader     c User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100402 Namoroka/3.6.3
13 RxHeader     c Pragma: no-cache
13 RxHeader     c Cache-Control: no-cache

(just the relevant headers)

When using the browser developer tool in Chromium it only shows one of
the headers ('no-cache') but Varnish seems to get two. Firebug in
Firefox only shows one header being sent and Varnish agrees.

-felix


On Fri, Apr 16, 2010 at 08:51:15PM +0100, Sam Crawford wrote:
> Gah, what a fool, I got the two muddled - swap F5 and Ctrl+F5 around below.
> 
> 
> 
> On 16 April 2010 20:40, Sam Crawford <samcrawford at gmail.com> wrote:
> > Hrmmm, which version of Chrome is that? I'm running the latest 5.0
> > beta and I'm seeing the following:
> >
> > ** Using F5 only **
> > GET /Headers/ HTTP/1.1
> > Host: xxxxxxxxxxx
> > Connection: keep-alive
> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
> > AppleWebKit/533.5 (KHTML, like Gecko) Chrome/5.0.378.0 Safari/533.5
> > Cache-Control: no-cache
> > Pragma: no-cache
> > Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> > Accept-Encoding: gzip,deflate,sdch
> > Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> >
> > ** Using CTRL+F5 **
> > GET /Headers/ HTTP/1.1
> > Host: xxxxxxxxxxxxxxxxx
> > Connection: keep-alive
> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
> > AppleWebKit/533.5 (KHTML, like Gecko) Chrome/5.0.378.0 Safari/533.5
> > Cache-Control: max-age=0
> > Pragma: no-cache
> > Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> > Accept-Encoding: gzip,deflate,sdch
> > Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> >
> > If I remember rightly, the above is also how Firefox handles
> > Cache-Control headers.
> >
> > I've not been able to make Chrome emit two Cache-Control headers on a
> > single request.
> >
> > Thanks,
> >
> > Sam
> >
> >
> >
> > On 16 April 2010 18:13, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> >> In message <20100416170714.GA4512 at thinkpad>, Felix writes:
> >>
> >>>Just a question about handling duplicate headers. I am currently using
> >>>Chrome and trying to get it to pass to the backend on a client forced
> >>>refresh. Chrome sends the following headers:
> >>>
> >>>  RxHeader     c Cache-Control: max-age=0
> >>>  RxHeader     c Cache-Control: no-cache
> >>>
> >>>and I have been trying to catch 'no-cache' but it never gets it with
> >>>this rule:
> >>>
> >>>  if (req.http.Cache-Control ~ "no-cache")
> >>>
> >>>as it seems to fill the 'Cache-Control' header spot with the first one
> >>>it finds, 'max-age'
> >>>
> >>>Is there a way to cope with this or is this a bug?
> >>
> >> I'll have to re-read the RFC, Chrome may be within spec, but they're
> >> certainly breaking tradition...
> >>
> >> --
> >> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> >> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> >> FreeBSD committer       | BSD since 4.3-tahoe
> >> Never attribute to malice what can adequately be explained by incompetence.
> >>
> >> _______________________________________________
> >> varnish-misc mailing list
> >> varnish-misc at varnish-cache.org
> >> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc
> >>
> >
> 
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc

-- 
  email: felix at seconddrawer.com.au
    web: http://seconddrawer.com.au/
    gpg: E6FC 5BC6 268D B874 E546 8F6F A2BB 220B D5F6 92E3

Please don't send me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html




More information about the varnish-misc mailing list