Before using this module, our anonymous content delivered always from varnish (x-cache = HIT). After using this module, only when logged in content delivered from varnish (x-cache = HIT), anonymous content always resulting x-cache = MISS.

I'm using attached vcl which is for varnish 2.

Any suggestion will be appreciated.

Thanks

Comments

Janne Salo’s picture

Assigned: Unassigned » Janne Salo

With this information, I can't tell what exactly is going wrong, but you could enable the development mode in the admin UI (admin/config/cache_control -> Enable development mode). This way, Cache control will tell you why a page wasn't cached. You will find this information in the response header X-DRCC-No-Cache-Reason.

Can you enable dev mode, check the said response header for those problematic pages and get back with the results?

gushil’s picture

You know what, I think I found the culprit.

If I enable Cache pages for anonymous users in Development > Performance, X-Cache always MISS on page, although X-Drupal-Cache is HIT.

Subsequently, when I disabled Cache pages for anonymous users, X-Cache is HIT. No X-Drupal-Cache header found, of course.

So, are we suppose to disable Cache pages for anonymous users if we want to use this module?

Janne Salo’s picture

Ah, right. Yes, Drupal page caching should be disabled if you want to use this module. If pages are being served from Drupal's cache, cache_control won't get the chance to do its magic in hook_init() (set the Cache-Control headers for Varnish, that is). So I suggest keeping the page cache disabled when using Cache control.

Janne Salo’s picture

Status: Active » Closed (works as designed)

I think this is resolved now. Will need to mention this in the documentation, though.