pkhamre/wp-varnish

Domain Mapping support

jasonheffner opened this issue · 5 comments

When the url is generated to purge the cache it is taken from the blog info. The result is on mapped domains the cache never gets purged.

I did some more testing and this now seems to work in my new environment correctly. I had reconfigured the virtualhost setup, and broke this temporarily. I'm running Pound in front of varnish.

This does appear to be an issue. The varnish cache for the mapped domain never gets banned/purged. The urls generated for the purge go off the admin site url.

I put an extremely small quick patch in place. This obviously is not the correct or best way to do this, but it currently is working and was easy.

wp-varnish.php:462

$wpv_wpurl = domain_mapping_siteurl('NA');

// $wpv_wpurl = get_bloginfo('url');

I found this article talking about the issue as well http://wordpress.org/support/topic/plugin-wordpress-varnish-wordpress-varnish-and-domain-mapping-plugin

I made a small update to make it a bit more correct, since domain mapping is implemented differently depending on which domain mapping plugin you use..

wp-varnish.php:462
// check for domain mapping plugin by donncha
if (function_exists('domain_mapping_siteurl'))
$wpv_wpurl = domain_mapping_siteurl('NA');
else
$wpv_wpurl = get_bloginfo('url');

http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

cd34 commented

Patched in commit 16e00fd, will merge soon.