This issue is related to this one #1323418: Support for Expire module option expire_include_base_url=1

When using Expire and Domain Access modules together with Varnish and have set expire_include_base_url to True in Expire settings, the paths sent to varnish_expire_cache function are the full URLs (ex. 'http://www.example.com/', 'http://www.example.it/page','http://www.example.se/page') which results in strange commands sent to varnish looking like:
ban req.http.host ~ "www.example.com" && req.url ~ "/http://www.example.com/some-page$|^/http://www.example.it/some-page$|^/http://www.example.es/some-page"

So the following patch handles several problems:

  • fixes varnish_expire_cache function to sent the right commands to Varnish not the ones shown above.
  • updates varnish_purge_all_pages so when a node is saved the cache is deleted not only on the current domain but on all aliases it may have
  • Currently when Clear All Caches button is clicked in Configuration->Performance it clears Varnish cache only on current domain. So a checkbox is added to choose wheather to delete on current(and its aliases) or an all exisiting domains.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

k.minkov’s picture

Status: Active » Needs review
FileSize
4.32 KB
k.minkov’s picture

Issue summary: View changes

text format

cinnamon’s picture

This patch didn't work for me. First of all we use the expire 2.x branche because of other problems, this doesn't seem to use expire_include_base_url. Second the extra options for cache clearing seem to break caching completely! Also the approach (clear all urls on all domains) doesn't seem valid in a shared enviroment.

So here's a new patch that only enables selective clearing with expire-7.x-2.x.

Also for all of this to work to any effect, you should put the domain access include in settings.php last. Otherwise you get funky results and effectively no page valid pagecaching at all!

wulff’s picture

Is this related to the issue being discussed at #2017097: Ban/purge requests to varnish are malformed.?

mgifford’s picture

Status: Needs review » Needs work