cache differences from ff to opera/ie

Mike hijinks at gmail.com
Thu Mar 18 17:25:16 CET 2010


When I hit a basic .html page with firefox, I get another hit if I use
chrome. If I use IE and Opera the first hit is always a miss then if i
reload I get a hit.

I'm using the following config.

backend default {
  .host = "192.168.100.53";
  .port = "80";
}

sub vcl_recv {
# Normalize Content-Encoding
    if (req.http.Accept-Encoding) {
        if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|lzma|tbz)(\?.*|)$") {
            remove req.http.Accept-Encoding;
        } elsif (req.http.Accept-Encoding ~ "gzip") {
            set req.http.Accept-Encoding = "gzip";
        } elsif (req.http.Accept-Encoding ~ "deflate") {
            set req.http.Accept-Encoding = "deflate";
        } else {
            remove req.http.Accept-Encoding;
        }
    }
# Remove cookies and query string for real static files
    if (req.url ~
"^/[^?]+\.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.*|)$")
{
       unset req.http.cookie;
       set req.url = regsub(req.url, "\?.*$", "");
    }
# Remove cookies from front page
    if (req.url ~ "^/$") {
       unset req.http.cookie;
    }
}
sub vcl_fetch {
        if (req.url ~ "^/$") {
                unset obj.http.set-cookie;
        }
}

sub vcl_deliver {
  if (obj.hits > 0) {
    set resp.http.X-Cache = "Varnish: HIT " obj.hits;
  }
  else {
    set resp.http.X-Cache = "Varnish: MISS";
  }
}

sub vcl_error {
  if (obj.status == 503 && req.restarts <= 5) {
    restart;
  }
}






Here is a varinishlog for opera



   12 SessionOpen  c 192.168.71.157 57733 :80
   12 ReqStart     c 192.168.71.157 57733 1009797700
   12 RxRequest    c GET
   12 RxURL        c /test.html
   12 RxProtocol   c HTTP/1.1
   12 RxHeader     c User-Agent: Opera/9.80 (X11; Linux i686; U; en)
Presto/2.2.15 Version/10.10
   12 RxHeader     c Host: www.theopenskyproject.stg
   12 RxHeader     c Accept: text/html, application/xml;q=0.9,
application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap,
*/*;q=0.1
   12 RxHeader     c Accept-Language: en-US,en;q=0.9
   12 RxHeader     c Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
   12 RxHeader     c Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
   12 RxHeader     c Cache-Control: no-cache
   12 RxHeader     c Connection: Keep-Alive, TE
   12 RxHeader     c TE: deflate, gzip, chunked, identity, trailers
   12 VCL_call     c recv
   12 VCL_return   c lookup
   12 VCL_call     c hash
   12 VCL_return   c hash
   12 VCL_call     c miss
   12 VCL_return   c fetch
   13 BackendOpen  b default 192.168.100.54 46963 192.168.100.53 80
   12 Backend      c 13 default default
   13 TxRequest    b GET
   13 TxURL        b /test.html
   13 TxProtocol   b HTTP/1.1
   13 TxHeader     b User-Agent: Opera/9.80 (X11; Linux i686; U; en)
Presto/2.2.15 Version/10.10
   13 TxHeader     b Host: www.theopenskyproject.stg
   13 TxHeader     b Accept: text/html, application/xml;q=0.9,
application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap,
*/*;q=0.1
   13 TxHeader     b Accept-Language: en-US,en;q=0.9
   13 TxHeader     b Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
   13 TxHeader     b Accept-Encoding: gzip
   13 TxHeader     b X-Varnish: 1009797700
   13 TxHeader     b X-Forwarded-For: 192.168.71.157
   13 RxProtocol   b HTTP/1.1
   13 RxStatus     b 200
   13 RxResponse   b OK
   13 RxHeader     b Date: Thu, 18 Mar 2010 16:23:34 GMT
   13 RxHeader     b Server: Apache
   13 RxHeader     b Accept-Ranges: bytes
   13 RxHeader     b Cache-Control: max-age=7200
   13 RxHeader     b Expires: Thu, 18 Mar 2010 18:23:34 GMT
   13 RxHeader     b Content-Length: 14
   13 RxHeader     b Connection: close
   13 RxHeader     b Content-Type: text/html; charset=UTF-8
   12 ObjProtocol  c HTTP/1.1
   12 ObjStatus    c 200
   12 ObjResponse  c OK
   12 ObjHeader    c Date: Thu, 18 Mar 2010 16:23:34 GMT
   12 ObjHeader    c Server: Apache
   12 ObjHeader    c Cache-Control: max-age=7200
   12 ObjHeader    c Expires: Thu, 18 Mar 2010 18:23:34 GMT
   12 ObjHeader    c Content-Type: text/html; charset=UTF-8
   13 BackendClose b default
   12 TTL          c 1009797700 RFC 7200 1268929414 0 0 7200 0
   12 VCL_call     c fetch
   12 VCL_return   c deliver
   12 Length       c 14
   12 VCL_call     c deliver
   12 VCL_return   c deliver
   12 TxProtocol   c HTTP/1.1
   12 TxStatus     c 200
   12 TxResponse   c OK
   12 TxHeader     c Server: Apache
   12 TxHeader     c Cache-Control: max-age=7200
   12 TxHeader     c Expires: Thu, 18 Mar 2010 18:23:34 GMT
   12 TxHeader     c Content-Type: text/html; charset=UTF-8
   12 TxHeader     c Content-Length: 14
   12 TxHeader     c Date: Thu, 18 Mar 2010 16:23:34 GMT
   12 TxHeader     c X-Varnish: 1009797700
   12 TxHeader     c Age: 0
   12 TxHeader     c Via: 1.1 varnish
   12 TxHeader     c Connection: keep-alive
   12 TxHeader     c X-Cache: Varnish: MISS
   12 ReqEnd       c 1009797700 1268929414.785295010 1268929414.787596941
0.000219107 0.002166986 0.000134945
   12 ReqStart     c 192.168.71.157 57733 1009797701




Here is a log from chrome



  12 SessionOpen  c 192.168.71.157 57742 :80
   12 ReqStart     c 192.168.71.157 57742 1009797702
   12 RxRequest    c GET
   12 RxURL        c /test.html
   12 RxProtocol   c HTTP/1.1
   12 RxHeader     c Host: www.theopenskyproject.stg
   12 RxHeader     c Connection: keep-alive
   12 RxHeader     c User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US)
AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.11 Safari/532.9
   12 RxHeader     c Cache-Control: max-age=0
   12 RxHeader     c Accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
   12 RxHeader     c Accept-Encoding: gzip,deflate,sdch
   12 RxHeader     c Cookie:
__utmz=193312050.1268919813.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
frontend=tmj6eo0u987s093h00gdd5t287;
__utma=193312050.1928613275.1268919813.1268919813.1268919813.1;
__utmc=193312050
   12 RxHeader     c Accept-Language: en-US,en;q=0.8
   12 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
   12 VCL_call     c recv
   12 VCL_return   c lookup
   12 VCL_call     c hash
   12 VCL_return   c hash
   12 Hit          c 1009797700
   12 VCL_call     c hit
   12 VCL_return   c deliver
   12 Length       c 14
   12 VCL_call     c deliver
   12 VCL_return   c deliver
   12 TxProtocol   c HTTP/1.1
   12 TxStatus     c 200
   12 TxResponse   c OK
   12 TxHeader     c Server: Apache
   12 TxHeader     c Cache-Control: max-age=7200
   12 TxHeader     c Expires: Thu, 18 Mar 2010 18:23:34 GMT
   12 TxHeader     c Content-Type: text/html; charset=UTF-8
   12 TxHeader     c Content-Length: 14
   12 TxHeader     c Date: Thu, 18 Mar 2010 16:25:01 GMT
   12 TxHeader     c X-Varnish: 1009797702 1009797700
   12 TxHeader     c Age: 87
   12 TxHeader     c Via: 1.1 varnish
   12 TxHeader     c Connection: keep-alive
   12 TxHeader     c X-Cache: Varnish: HIT 1
   12 ReqEnd       c 1009797702 1268929501.792177916 1268929501.792538881
0.000161886 0.000236988 0.000123978
   12 Debug        c "herding"
    0 CLI          - Rd ping
    0 CLI          - Wr 0 200 PONG 1268929502 1.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100318/05f6258e/attachment-0003.html>


More information about the varnish-misc mailing list