I've found that the cache never clears if the "Flush page cache on cron?" is enabled.

I think the culprit is (variable_get('varnish_flush_cron', 0) && lock_may_be_available('cron'))) in varnish.cache.inc.

If a check is added to see if varnish_cache_clear is set then flush on cron and flush on Drupal cache can both be enabled: variable_get('varnish_flush_cron', 0) && lock_may_be_available('cron')) && !variable_get('varnish_cache_clear', 1)).

I see that the expire module bypasses drupal cache and purges elements directly, so that wouldn't be affected.

Attached is a patch.

CommentFileSizeAuthor
#1 varnish-cron-fix-1461792-01.patch609 bytesacouch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acouch’s picture

Patch attached for real this time.

Dane Powell’s picture

Hmm... I applied this patch, but after editing a node the old version was still getting served up. It could be because I'm still suffering from #1232448: Editing nodes - Purge-command to Varnish not working anymore, which might eclipse this issue...

Dane Powell’s picture

Status: Active » Reviewed & tested by the community

Okay, yep- once I solved that other issue, I see that this really is an issue and the patch in #1 solves it. Although, I could see how this might be more of a user interface issue- i.e., if set to clear cache on cron, the module will ONLY clear cache on cron...

acouch’s picture

I think it makes more sense to have the option to clear at cron AND when when the normal Drupal cache is cleared. An example would be if you have something that grabs data from an outside service or doesn't use entities to update. We'd like to be able to clear those at a certain time while still being able to have the cache clear upon node edits etc.

If the maintainer doesn't feel that way PLEASE at leaset update the description because I spent quite some time tracking this down and would like to save anyone else the trouble.

fabsor’s picture

The cache clear should be done both on cron AND together with whatever setting you set (Drupal default, standard or none), so I agree that this is a bug.

fabsor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.