Closed (works as designed)
Project:
Cache Control
Version:
7.x-1.0-beta1
Component:
Miscellaneous
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
8 May 2013 at 04:57 UTC
Updated:
10 May 2013 at 06:35 UTC
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
Comment #1
Janne Salo commentedWith 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?
Comment #2
gushil commentedYou 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?
Comment #3
Janne Salo commentedAh, 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.
Comment #4
Janne Salo commentedI think this is resolved now. Will need to mention this in the documentation, though.