<div dir="ltr">Wow, that was quick! :-)<div><br></div><div>Ok, may I describe my backend and then can you suggest whether or not Varnish will suite here?</div><div><br></div><div>The server (Tomcat) basically acts as a cache, where the key is page url and the value is some info on the page. Clients accessing the service pass the url in the request, and if the data exist in the cache, it will be returned to client, otherwise a default response will be returned to client, and a background process will start process the page, in its end the page data will be placed in the cache. So, since Tomcat (java) do not handle network very well in high scales, I was thinking I could use Varnish to cache backend responses in case found in the service cache. Isn't it possible to configure Varnish to fetch from cache based on some header in the request (in my case it will be the page url that client is querying)?</div>
<div><br></div><div>Hope I was clear enough,</div><div><br></div><div>Barak.<br><br><div class="gmail_quote">On Thu, Sep 15, 2011 at 4:25 PM, Per Buer <span dir="ltr"><<a href="mailto:perbu@varnish-software.com">perbu@varnish-software.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<div><br><br><div class="gmail_quote"><div class="im">On Thu, Sep 15, 2011 at 3:19 PM, Barak Yaish <span dir="ltr"><<a href="mailto:barak.yaish@gmail.com" target="_blank">barak.yaish@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><br></div><div>I'm new to Varnish, and I didn't find in the docs how to do the following - cache the response based on customized HTTP header (which the backend may or may not set), for example cache the response in case the one of the response headers is "SomeHeader".</div>
</div></blockquote><div><br></div></div><div>How will Varnish know the value of the response header before it has talked to the backend?</div><div><br></div><div>Cache lookups happend after we get the request, and at that time the response headers are unknown. You need to figure out what content to deliver purely based on the request.</div>
</div><div><br></div><font color="#888888">-- <br><img><div>Per Buer, CEO<br>Phone: <a href="tel:%2B47%2021%2098%2092%2061" value="+4721989261" target="_blank">+47 21 98 92 61</a> / Mobile: <a href="tel:%2B47%20958%2039%20117" value="+4795839117" target="_blank">+47 958 39 117</a> / Skype: per.buer<br>
<i>Varnish makes websites fly!</i><div>
<a href="http://www.varnish-software.com/whitepapers" target="_blank">Whitepapers</a> | <a href="http://www.youtube.com/watch?v=x7t2Sp174eI" target="_blank">Video</a> | <a href="https://twitter.com/varnishsoftware" target="_blank">Twitter</a> <br>
<br></div></div><br>
</font></div>
</blockquote></div><br></div></div>