4

I would like to set up Varnish as reverse proxy cache for Apache.

How can I setup Varnish so that it does not cache content from a particular folder (and its subfolders), let's say /public_html/shop/

OC2PS
  • 539
  • 2
  • 8
  • 21
  • Can you provide your current VCL config? – Shane Madden Nov 05 '13 at 23:52
  • @ShaneMadden As I mentioned in the question, I "would like to" setup Varnish. So there's no current config to speak of. Let's assume Varnish default config. In any case, I suspect basing the answer on default config would be useful to more users than basing it on a particular config. – OC2PS Nov 06 '13 at 05:04

1 Answers1

9

You'd want something like this in your vcl_recv:

if (req.url ~ "^/path/to/exclude/") {
  return (pass);
}

You'll probably need to familiarize yourself with the basics of what the default VCL is doing and adjust for your content - for example, by default, it'll avoid caching anything when the client sends any cookies on the assumption that your content might vary based on sent cookies.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248