Hi all -<div><br></div><div>I'm attempting to implement a suggestion provided as a solution to another question I posted regarding cache warming.</div><div><br></div><div>Long story short, I have 6 webservers that I'm pre-warming 60,000 urls via a script. I had previously been sending each request to each web-server, but it was suggested that it would be much quicker, and indeed more elegant, to be able to set a header (X-Cache-Warming in this case) that if set would cause the web-server to use the next web server as the backend, until it reached the last web server and it would be fetched via the actual backend: Goal - Make a single request on the first web server to warm all 6.</div>
<div><br></div><div>The issue I'm seeing is following cache warming the I get cache misses on actual requests on all web servers except the last in the chain, which would imply to me that Varnish implicitly hashes the backend name used. A summary of the VCLused:</div>
<div><br></div><div><div class="gmail_extra">On all servers except the "last" in the chain I've defined:</div><div class="gmail_extra"><br></div><div class="gmail_extra">backend system {</div><div class="gmail_extra">
.host = <a href="http://system1.domain.com">system1.domain.com</a></div><div class="gmail_extra"> .port=80</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra" style>
<span class="il" style="background-image:initial;background-color:rgb(255,255,204)">backend</span> next_web_server {</div><div class="gmail_extra" style> .host = "<a href="http://webx.domain.com/" target="_blank" style="color:rgb(17,85,204)">webX.domain.com</a>";</div>
<div class="gmail_extra" style> .port = "80";</div><div class="gmail_extra" style>}</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>And have added the following to vcl_recv for all web servers except the last:</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style> # On all webservers except the last START</div><div class="gmail_extra" style><div class="gmail_extra"> if (req.http.X-Cache-Warming ~ "true") {</div>
<div class="gmail_extra"> set req.<span class="il" style="background-image:initial;background-color:rgb(255,255,204)">backend</span> = next_web_server;</div><div class="gmail_extra"> set req.hash_always_miss = true;</div>
<div class="gmail_extra"> return(lookup);</div><div class="gmail_extra"> }</div><div class="gmail_extra"> # On all webservers except the last END</div><div class="gmail_extra"> </div><div class="gmail_extra"> set req.<span class="il" style="background-image:initial;background-color:rgb(255,255,204)">backend</span> = system;</div>
<div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">And have the following vcl_hash:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">sub vcl_hash {</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> hash_data(req.url);</div><div class="gmail_extra"> hash_data(req.http.host); </div><div class="gmail_extra"> return(hash);</div><div class="gmail_extra">}</div>
</div></div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>Any help would be very much appreciated, even if only a "yes this is how it works, no there's no workaround" :)</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>Cheers,</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>Neil</div><div class="gmail_extra" style><br></div></div></div>