a few intro to Varnish questions

Jason S-M slackmoehrle.lists at gmail.com
Tue Jan 18 23:25:55 CET 2011


Thanks for the reply. very helpful.

>> So I have to run varnish on 80 and my site on an alternate port (8080 as example)? Or do they both run on port 80?
> Yes, you need to run varnish on port 80, so that all requests hit Varnish first, Varnish will then fetch contents from your Apache server running on any other port ie. 8080, cache it and send response to requesting client.

I put Varnish on 80 using: 

varnishd -f /etc/varnish/default.vcl -s malloc,1G -T -a

and I changed httpd.conf to: Listen

in /etc/varnish/default.vcl I have:
backend default {
 .host = "";
 .port = "8080";

Upon doing this and hitting my url: http://6colors.net it seems to be in an infinite loop, Chrome just seems to loop and loop and loop.

>> 3. I must make additions to vcl_recv I assume to cache what I want?
> In vcl_recv, you can select what you want to serve from cache, you might want to serve php pages directly and cache only static contents, depending on your requirements, in vcl_fetch  you need to set how long you want content to be cached, setting TTL, you can also set TTL based on content types, please read the doc firsthttp://www.varnish-cache.org/docs/2.1/

I am confused. Can we use an example? Say I wanted to cache these:




Thanks for explaining, I appreciate it. Some of these docs seems confusing!


More information about the varnish-misc mailing list