Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a default vhost setup on my Debian box (a demo, I wanted to see how Varnish caching works and whether it could solve a speed problem).

All was well with the default host, lots of cache hits and the occasional miss. Cool.

So I added a vhost through Apache, hooked up WordPress (I know about the cookie problems) and tried loading it's readme.html file. Still quick, but it's stopped hitting/missing the cache altogether, despite having absolutely no dynamic references. Images also aren't cached at all.

Any suggestions for what could be going wrong? I used a2ensite but above that did no additional configuration for the new vhost.

share|improve this question

What cookies are in use? Unless you strip them out varnish will consider the content un-cachable. Also, post a copy of your config so people can see exactly what you're running.

EDIT: I re-read you question and see you say you've already sorted cookies. Can we still see your config?

share|improve this answer
Okay well here goes: [that failed. since when did return submit??] CONFIG: backend default { .host = ""; .port = "8080"; } # Drop any cookies sent to Wordpress. sub vcl_recv { if (!(req.url ~ "wp-(login|admin)")) { unset req.http.cookie; } } # Drop any cookies Wordpress tries to send back to the client. sub vcl_fetch { if (!(req.url ~ "wp-(login|admin)")) { unset obj.http.set-cookie; } } – George Pearce Jul 5 '11 at 16:00
However, I only added the wordpress bits recently, and now on compiling I get this: Message from VCC-compiler: 'obj.http.set-cookie': cannot be unset in method 'vcl_fetch'. At: ('input' Line 21 Pos 31) unset obj.http.set-cookie; ------------------------------###################- Running VCC-compiler failed, exit 1 VCL compilation failed (Note- Varnish wasn't caching at all with static things like images and the readme file either so the lack of the cookie thing ^ didnt change that. From: – George Pearce Jul 5 '11 at 16:03
@George - can you just edit your original question, and add the config to the end of your post? Or just use – Coops Jul 5 '11 at 16:07
Try vcl_rcv instead – 3molo Jul 5 '11 at 16:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.