Mailing List Archive

Correct no cache headers ?
Hi

What are the correct cache headers to set if I need to tell varnish
not to cache a file.

Right now I use :

Pragma: no-cache
Cache-Control: s-maxage=0, max-age=0, must-revalidate, no-cache

But sometimes I get some other users cached file, and it seems to be
when I try to get a file in the exact same moment as som eother user.

In vcl i have the following code to allow caching af some of the
files even though a user is logged in.

# force lookup even when cookies are present
if (req.request == "GET" && req.http.cookie) {
lookup;
}

And when i request the file I get the following in varnishlog

15 VCL_call c recv
15 VCL_return c lookup
15 VCL_call c miss
15 VCL_return c fetch

16 RxHeader b Pragma: no-cache
16 RxHeader b Cache-Control: s-maxage=0, max-age=0, must-
revalidate, no-cache
16 RxHeader b Expires: Fri, 05 Jan 2007 08:57:03 GMT
16 RxHeader b Content-Length: 1555
16 RxHeader b Connection: close
16 RxHeader b Content-Type: text/javascript
15 TTL c 277100755 RFC 0 1168592154 1168592223
1167987423 0 0
15 VCL_call c fetch
15 VCL_return c insert

Could it be the insert that is made by varnish that is the problem ?


Regards,

Henrik Nicolaisen
TV 2 Interaktiv


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.linpro.no/pipermail/varnish-misc/attachments/20070112/f4702f2e/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1931 bytes
Desc: not available
Url : http://projects.linpro.no/pipermail/varnish-misc/attachments/20070112/f4702f2e/attachment.bin
Correct no cache headers ? [ In reply to ]
In message <5AD6C93C-0E2B-4748-BD22-16A28F8261A8 at tv2.dk>, Henrik Nicolaisen wri
tes:

>But sometimes I get some other users cached file, and it seems to be
>when I try to get a file in the exact same moment as som eother user.

Hmm, yes, that could possibly happen with the current code.

Can I get you to file a bug report in the trac system ?

--
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.