Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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 = "127.0.0.1"; .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: varnish-cache.org/trac/wiki/VarnishAndWordpress –  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 pastebin.com –  Coops Jul 5 '11 at 16:07
    
Try vcl_rcv instead –  3molo Jul 5 '11 at 16:13
add comment

Your Answer

 
discard

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.