Correct no cache headers ?

Henrik Nicolaisen hema at tv2.dk
Fri Jan 12 09:59:06 CET 2007


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: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20070112/f4702f2e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1931 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20070112/f4702f2e/attachment-0002.bin>


More information about the varnish-misc mailing list