<div dir="ltr">Hi all,<div><br></div><div> I seem to be getting a pretty good cache / hit ratio on my current VCL config. </div><div><br></div><div>Hitrate avg: 0.9077 0.9242 0.9242</div><div><br></div><div>However I notice that if I stop my web server and go to the site I'm working with, instead of seeing a cached copy of the site, I instead see a varnish guru meditation error.</div><div><br></div><div>I thought that the key to getting the site cached in such a way that you could completely stop the webserver and still view the site via the cache had a lot to do with this following line:</div><div><br></div><div><div> if(req.http.cookie ~ "cc_loggedin" || req.http.cookie ~ "PHPSESSID"){</div><div> return(pass);</div><div> }</div></div><div><br></div><div>I had a look at the cookies for the site and put them in the above line. However I get no results with that. </div><div><br></div><div>Here's the full VCL file:</div><div><br></div><div><div>probe healthcheck {</div><div> .url = "/healthcheck.php";</div><div> .timeout = 5s;</div><div> .interval = 2s;</div><div> .window = 5;</div><div> .threshold = 3;</div><div>}</div><div><br></div><div>backend web1 {</div><div> .host = "10.10.10.94";</div><div> .port = "80";</div><div> .probe = healthcheck;</div><div> .connect_timeout = 30s;</div><div> .first_byte_timeout = 30s;</div><div> .between_bytes_timeout = 30s;</div><div> .max_connections = 70;</div><div>}</div><div><br></div><div><br></div><div>director www client {</div><div> { .backend = web1 ; .weight = 2; }</div><div> }</div><div><br></div><div><br></div><div>sub vcl_recv {</div><div><br></div><div><br></div><div> set req.backend = www;</div><div><br></div><div> if(req.http.cookie ~ "cc_loggedin" || req.http.cookie ~ "PHPSESSID"){</div><div> return(pass);</div><div> }</div><div><br></div><div><br></div><div> if (req.backend.healthy) {</div><div> set req.grace = 30s;</div><div> } else {</div><div> set req.grace = 4h;</div><div> }</div><div><br></div><div> return (lookup);</div><div>}</div><div><br></div><div>sub vcl_fetch {</div><div><br></div><div> if ( req.http.host == "<a href="http://www.ref.mydomain.com">www.ref.mydomain.com</a>" || req.http.host == "<a href="http://www.beta.mydomain.com">www.beta.mydomain.com</a>" ) {</div><div> set beresp.ttl = 3600s;</div><div> }</div><div><br></div><div> if ( req.url ~ "^/index.php$" || req.url ~ "^/cometchat/cometchat_receive.php$") {</div><div> set beresp.ttl = 3600s;</div><div> }</div><div><br></div><div> set beresp.grace = 4h;</div><div><br></div><div> return (deliver);</div><div>}</div><div><br></div><div>sub vcl_deliver {</div><div> if (obj.hits> 0) {</div><div> set resp.http.X-Cache = "HIT";</div><div> } else {</div><div> set resp.http.X-Cache = "MISS";</div><div> }</div><div> }</div><div><br></div><div><br></div><div>Could someone have a look at this VCL and give some opinion as to why this is happening?</div><div><br></div><div>Thanks</div><div>Tim</div>-- <br><div class="gmail_signature">GPG me!!<br><br>gpg --keyserver <a href="http://pool.sks-keyservers.net" target="_blank">pool.sks-keyservers.net</a> --recv-keys F186197B<br><br></div>
</div></div>