Posted by gilzero on May 10, 2012 at 3:47pm
Hello
My stack:
- Ubuntu / LAMP
- Drupal 7.14
- Varnish 3.0.2
- HTTP port 8080 / varnishd port 80
varnishd is running in front of backserver.
Basically, X-Varnish-Cache = MISS in header for ALL the pages, not caching anything at all.
I also tested in http://www.isvarnishworking.com , the result confirmed, please see my screenshot below
HTTP header screenshot:

www.isvarnishworking.com test result screenshot:

Vanish module settings:

Performance settings:

settings.php:
// Add Varnish settings
$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
$conf['cache_class_cache_page'] = 'VarnishCache';
$conf['page_cache_invoke_hooks'] = FALSE;default.vcl :
(Attached below: default.vcl_.txt)
==================================
What is wrong with my set up? Do I miss anything?
Thank you in advanced!
| Attachment | Size |
|---|---|
| default.vcl_.txt | 8.3 KB |
Comments
If you hit the origin server,
If you hit the origin server, does it also have the Cache-Control: no-cache? (I will bet it does.)
What if you serve up a static file? (remove PHP configuration from the mix)
If that still has no-cache then it's the origin server's configuration. (My suspicion.)
Hello loryrin, thanks for
Hello loryrin, thanks for your reply.
Re:
You mean browse to backend server directly? I open http://mysite.com:8080, checked the header, the Cache-Control value is: [Cache-Control: max-age=0, no-cache]
Re:
Yes, if I browse a static file. http://mysite.com/sites/default/abc.jpg . It works, Varnish cached it.
in the header: [X-Varnish-Cache: HIT]
Any ideas?
No ideas, but that at least
No ideas, but that at least narrows it down to application behavior.
Pressflow
Drupal 6 needs Pressflow core to play nice with Varnish:
http://pressflow.org/
https://pantheon.io | http://www.chapterthree.com | https://www.outlandishjosh.com
Hello joshk Thanks for reply,
Hello joshk
Thanks for reply, I am using Drupal 7 with Varnish 3 in this case.
Oh. Problem found. The break
Oh. Problem found. The break caused by mod_pagespeed module intentionaly sets max-age to 0