Hello All,<br><br>I'm designing a sort of distributed file system used for file serving and have been looking at multiple methods of reverse proxy caching static content and I have to say Varnish looks like a really great product.
<br><br>I have some questions as to how I can incorporate Varnish into my setup in the most optimal way. <br><br>In the current implementation, I have multiple sites using the same content system on the back end, using CNAME'd domains and a layer of application logic to decide how to serve the file. In the file system, files are completely unique in that even if a file exists across multiple sites, it can be referred to in many ways while only being stored once.
<br><br>For instance:<br>-----<br><a href="http://app1.example.com">app1.example.com</a> is a CNAME for <a href="http://content.example.com">content.example.com</a><br><a href="http://app2.example.com">app2.example.com</a>
is a CNAME for <a href="http://content.example.com">content.example.com</a><br>etc.<br><br>A request comes in for <a href="http://app1.example.com/image.jpg">http://app1.example.com/image.jpg</a>.<br><br><a href="http://content.example.com">
content.example.com</a> examines the request and responds with:<br><br>Location: <a href="http://server10.content.example.com/storage/real_image_name.jpg">http://server10.content.example.com/storage/real_image_name.jpg</a>
<br><br>Another request comes in for <a href="http://app2.example.com/test.jpg">http://app2.example.com/test.jpg</a> which <a href="http://content.example.com">content.example.com</a> identifies as being the same file as real_image_name.jpg and responds with an identical Location header.
<br>-----<br><br>I'm trying to keep my path translation in logic that would be external from Varnish, as in some cases it's more extensive than a regular expression. The whole ordeal can be an expensive process which is where caching comes in.
<br><br>So is there some method of hosting the same file in multiple places while only having to cache the file once inside Varnish using an external application to decide what the ultimate URL is?<br>Does Varnish follow Location headers? Or is there some method of redirecting Varnish to the end location of a file?
<br><br>If these are features that are not currently available, can anyone point me to any past discussions about similar setups or give me a heads up if it's even something Varnish ever plans on doing?<br><br>This would be less of an issue if this didn't happen so often in the way I'm using the back end file system. but as it is, it happens quite a bit and in a straight URL to cache item configuration causes me to waste a lot of disk space/memory/IO performance.
<br><br><br>Thanks in advance,<br>-Max<br><br>