I see that the 6.x version includes Varnish rules actions, but I can't find them anywhere for 7.2. The documentation refers to them; where can I find them to add them to my rules? thanks!

Comments

mariano.barcia’s picture

wondering the same here

bibo’s picture

Issue summary: View changes

I think you are looking for the cache_page bin? It can be used when varnish-module is setup and used as cache backend, like this in settings.php:

$conf['cache_class_cache_page'] = 'VarnishCache';

In rules you then clear a cache-bin of type page_cache. In the box you can specify the url, or url-matching regex-pattern (without hostname).

bibo’s picture

Hope my answer cleared things up.

Btw: the expire module 7.2-series also has rules integration, and can be used to flush page caches in a similar way.

bibo’s picture

Assigned: Unassigned » bibo
Status: Active » Fixed

Settings this as fixed.

Status: Fixed » Closed (fixed)

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

vinmassaro’s picture

@bibo: I dug through the code and the 7.x-2.x-dev version only lets you choose to flush the cache_page bin, but does not offer a 'Clear cached paths in Varnish' option the way the 6.x-2.x version of the module does. That version allows for you to specify paths or regex to clear. The 7.x-2.x version does not have this functionality, and just lets you flush the cache_page bin which flushes all cached pages from Varnish.

vinmassaro’s picture

Category: Support request » Bug report
Status: Closed (fixed) » Active

I'm reopening this because my solution doesn't seem to work in #6. I also can't get this to work when choosing the 'Clear a specific cache cid' option and passing in a few paths. I basically have a rule that checks if a certain content type has been updated, and I'm trying to flush the home page and the Latest News page from Varnish. Right now I had to resort to doing this from a 'Execute custom PHP code' action:

$paths = array('', 'latest-news');
varnish_expire_cache($paths);

Can someone confirm they have this working to clear paths in Varnish using what is provided with Cache Actions?

robinmofo’s picture

Cache actions does not integrate with Varnish, yeah it can clear the cache_page table but that's not Varnish.

You'll be better off installing the expire module which will also allow better control over the headers sent to Varnish as well as having the needed hooks firing to purge from Varnish when you do things like update content.

I've always installed expire for Varnish and cache_actions for Drupal caches.