Varnish 3 can't cache, all MISSed. Using Drupal 7

Events happening in the community are now at Drupal community events on www.drupal.org.
gilzero's picture

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:


Only local images are allowed.

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!

AttachmentSize
default.vcl_.txt8.3 KB

Comments

If you hit the origin server,

lotyrin's picture

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

gilzero's picture

Hello loryrin, thanks for your reply.

Re:

If you hit the origin server, does it also have the Cache-Control: no-cache? (I will bet it does.)

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:

What if you serve up a static file?

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

lotyrin's picture

No ideas, but that at least narrows it down to application behavior.

Pressflow

joshk's picture

Drupal 6 needs Pressflow core to play nice with Varnish:

http://pressflow.org/

Hello joshk Thanks for reply,

gilzero's picture

Hello joshk

Thanks for reply, I am using Drupal 7 with Varnish 3 in this case.

Oh. Problem found. The break

gilzero's picture

Oh. Problem found. The break caused by mod_pagespeed module intentionaly sets max-age to 0

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: