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.
Comments
Comment #1
k.minkov CreditAttribution: k.minkov commentedComment #1.0
k.minkov CreditAttribution: k.minkov commentedtext format
Comment #2
cinnamon CreditAttribution: cinnamon commentedThis 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!
Comment #3
wulff CreditAttribution: wulff commentedIs this related to the issue being discussed at #2017097: Ban/purge requests to varnish are malformed.?
Comment #4
mgifford