This module is exactly what I need. I am unable to test it properly though.
I have Varnish(2.1.4) & Memcache(1.4.5).
I have used page cache set to Varnish in settings.php:
$conf['cache_backends'] = array('sites/all/modules/contrib/varnish/varnish.cache.inc');
$conf['cache_class_cache_page'] = 'VarnishCache';
$conf['cache'] = 1;
$conf['cache_lifetime'] = 0;
$conf['page_cache_maximum_age'] = 21600;
I also have setup memcache and assigned other bins to memcache clusters.
I created this rule to clear cache_page when an 'article' node is updated:
{ "rules_cache_clear_article_update" : {
"LABEL" : "Cache clear on article update",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "cache_actions" ],
"ON" : [ "node_update" ],
"IF" : [
{ "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "article" : "article" } } } }
],
"DO" : [
{ "cache_actions_action_clear_cache" : { "tables" : { "value" : { "cache_page" : "cache_page" } } } }
]
}
}
However, after editing the title of an article node, the cache_page bin is not flushed. I was expecting Varnish to have purged completely. But I still see HITs for pages as an anonymous user after this. Am I testing this correctly?
Comments
Comment #1
fabsor commentedHi!
I tried this out locally and it worked fine for me, which leads me to believe this is a problem with the connection to the Varnish server.
* Does it say that the connection to the Varnish server was successful under admin/config/development/varnish ? If not, could you go through your watchdog and look for errors that Varnish might be outputting?
* Which version of Varnish are you running?
Also note that Drupal will invalidate the whole page cache each time a node is saved by default. This can be prevented by enforcing a minimum cache lifetime or to configure the Varnish module to not purge anything at all.
Comment #2
girishmuraly commentedHi, thanks for the reply.
* At admin/config/development/varnish, I do get the message
"Varnish running. Observe more detailed statistics here"
* Also on the above page, 'Varnish Cache Clearing' is set to None.
* Varnish version: 2.1.4
As shown in my settings.php snippet above, I have set 'cache_lifetime' to 0 and also set a maximum age.
I do not see any watchdog log messages after my node is updated. I think it would be helpful to have a message on success as well.
Is there any other info that would help you analyse this bug? Thanks.
Comment #3
fabsor commentedAfter doing som digging I realized that this is an issue with the Varnish module. When it is set to "none", it clears nothing, even if you specificly tell it to invalidate the cache through for instance Cache Actions. I'm moving this to the Varnish issue queue, with a patch attached that fixes this problem. Please try it out and see if it works for you.
Comment #4
fabsor commentedIt seems that something went wrong with the file upload. Trying again.
Comment #5
girishmuraly commentedTested patch #14 and I was able to clear cache_page bin (varnish) with the above setup. Thanks.
Marking as RTBC.
Comment #6
fabsor commentedAlright, pushed to 7.x-1.x