Hi Lasse,<div>Correct me if I'm wrong, but vcl_miss is not available in varnish 2.1 (suggested <a href="https://www.varnish-software.com/static/book/Cache_invalidation.html#naming-confusion">here</a>). Is there a varnish 2.x approach that would improve the response times?</div>
<div><br></div><div>As an aside, our content is very broad-- there is a LOT of it. Its unlikely that serialization would be a concern for the bots unless multiple bots happend to hit content simultaneously that wasn't currently hot. </div>
<div><br></div><div>That being said, we are exploring some form of caching for the bots. The rules/ttls should probably look different than our normal traffic.</div><div><br></div><div>Thanks for the followup. I really appreciate it.</div>
<div><br></div><div>Damon<br><div><br><div class="gmail_quote">On Wed, Jul 25, 2012 at 4:17 AM, Lasse Karstensen <span dir="ltr"><<a href="mailto:lasse.karstensen@gmail.com" target="_blank">lasse.karstensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Damon Snyder:<br>
<div class="im">> Hi Lasse,<br>
> Thanks! I forgot to mention this in the original email, but we are using<br>
> varnish 2.1.5. Here is what I ended up doing:<br>
> sub vcl_fetch {<br>
>     ...<br>
>     if (req.http.User-Agent ~<br>
> "(?i)(msn|google|bing|yandex|youdao|exa|mj12|omgili|flr-|ahrefs|blekko)bot"<br>
> ||<br>
>         req.http.User-Agent ~<br>
> "(?i)(magpie|mediapartners|sogou|baiduspider|nutch|yahoo.*slurp|genieo)") {<br>
>         set beresp.http.X-Bot-Bypass = "YES";<br>
>         set beresp.ttl = 0s;<br>
>         return (pass);<br>
>     }<br>
>     ...<br>
> }<br>
<br>
</div>Hi Damon.<br>
<br>
Just a quick note; doing this check in vcl_fetch will lead to serialisation<br>
of backend requests. This will hurt your HTTP response times, and since these<br>
bots take response time into account, probably also hurt your search engine<br>
visibility.<br>
<br>
I'd advice you to do this test in vcl_miss, and also not override beresp.ttl<br>
so that Varnish stores the hit_for_pass object for a while.<br>
<br>
If you need to set the debug header you can store it temporarily in<br>
req.http.x-bot-bypass and check/set resp.http.x-bot-bypass in vcl_deliver.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Lasse Karstensen<br>
Varnish Software AS<br>
<a href="http://www.varnish-software.com/" target="_blank">http://www.varnish-software.com/</a><br>
<br>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</div></div></blockquote></div><br></div></div>