-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve compatibility with MU Domain Mapping plugin #339
Comments
I'm having the same issue with a subdomain multi-site installation with domain mapping on the sub sites. Can you please look into it? I'm using ZenCache Pro (multisite) v.150409. I should add that the site setup is such that the admin address is on a subdomain (as per installation), but the front-end is on its own domain (set as primary domain). It's with the following setting enabled: "Redirect administration pages to site's original domain (remote login disabled if this redirect is disabled)". The plugin is <a href="https://wordpress.org/plugins/wordpress-mu-domain-mapping/" target=_blank">Wordpress MU Domain Mapping. |
@ThePopularizer Thank you for sharing that helpful information. :-) Full WordPress Multisite compatibility is a priority on development roadmap. |
+1 for this feature request 👍 |
+1, but I don't see this as a feature request. Posts don't clear cache on update currently while using the domain mapping plugin. I was disappointed not seeing this fixed for the next release as this is crucial for our users. |
@scottelkin Hey I am disappointed too to not see a fix for this in the upcoming release. But hey, lets be honest. This upcoming release is the most major update of zencache supporting multi site. Previous of this release you can just activate it as network activate but practically it was useless in terms of multisite. But with this upcoming update, multisite has been taken seriously for the first time and that is why a lot of major improvements are coming up like cdn support, cache support etc. So, I'm not sure when zencache team will work on domain mapping thing, but I think they will work on it may be in the next next release. As almost every multisite uses domain mapping plugin, hence this is a serious feature request. Hope to see it soon. 👍 |
@scottelkin Have you tested the latest release candidate with Domain Mapping or were you testing the last public release (v150409)? |
I have not tested it. I was just commenting from the RC notes which didn't include this bug fix. If this functionality was fixed, I sincerely apologize! |
@scottelkin There was a lot of functionality added to the latest RC related to multisite. Domain Mapping should work as of the latest RC, however this GitHub issue was specifically left open because we haven't fully tested the latest multisite functionality with Domain Mapping. Once it has been tested and confirmed working without issue, I will update this GitHub Issue. |
Update: Domain Mapping Compatibility (as of v150605 RC)I just got through testing ZenCache Pro v150605 (Release Candidate) with a WordPress Multisite Network using Sub-Domains (e.g., The following works as expected:
Everything else also works as expected, as long as one of the Domain Mapping Plugin options is disabled (see below). Automatic Cache Purging when Publishing/Updating Posts on the DashboardBy default, the Domain Mapping Plugin options are configured with an option that says to "Redirect administration pages to site's original domain". With that option enabled (the default), visiting the Dashboard for That currently poses a problem for ZenCache. When you do anything in the Dashboard that requires ZenCache to purge a cache file (such as updating a published post), ZenCache looks for a cache file for If we uncheck that Domain Mapping Plugin option that redirects administration pages to the original site, then visiting the Dashboard for the mapped domain does not redirect you and instead you get sent to How ZenCache can improve Domain Mapping Plugin supportWhen building the path to the cache file that should be purged, ZenCache should check if the Domain Mapping plugin is installed and if there is a mapping in place for the current domain, e.g., if the domain is Because that issue (automatic purging not working because Dashboard and front-end domains don't match) was the original issue described in this thread, I'm leaving this GitHub issue open and considering Domain Mapping Plugin support to still be broken. We either need to fix this so that ZenCache searches the mapped domains table, or we need to provide a clear warning message to site owners when they have that particular Domain Mapping Plugin option enabled (as that option, which is enabled by default, effectively breaks ZenCache in a quiet way). cc @jaswsinc |
Cool. Thanks for that insight Raam. That makes it crystal clear. If I remember correctly, domain mapping plugins alter the |
I just checked this by doing a |
|
I see! Thanks then. |
So after looking closer at the if (defined('DOMAIN_MAPPING') && DOMAIN_MAPPING) {
global $wpdb, $blog_id;
$sub_domain = $wpdb->get_var("SELECT `domain` FROM `".$wpdb->blogs."` WHERE `blog_id` = '".esc_sql($blog_id)."' LIMIT 1");
} Untested code sample ↑ ... just observing at the moment, and trying to help. |
@jaswsinc I was thinking we wanted the exact opposite: When someone is visiting the Dashboard for a mapped site, the Dashboard will use the sub-domain address (e.g., I say that's "wrong" because I'm thinking the cache files should be built using the mapped domain (e.g., It sounds like you're saying that the front-end of the site where cache files are generated should actually be using the original Sub-Domain address (not the mapped domain address) to generate cache files, and should ignore the domain mapping altogether. (Either approach would work in my mind--I'm just trying to clarify what you're thinking here.) |
Thanks for pointing that out. Nope, I wasn't saying that, I was just plain wrong. I agree, I had this backwards in my last reply.
I would vote for the approach that you first mentioned here; i.e., that we cache the I think, and agree, that this makes the most sense. I'd rather see us caching the actual Here is a revised code sample. Again, this is untested at the moment. if(is_multisite() && function_exists('domain_mapping_siteurl') && get_site_option('dm_redirect_admin')) {
$mapped_domain = (string) parse_url(domain_mapping_siteurl(home_url()), PHP_URL_HOST);
} A closer look at the above...
|
Thanks! I did some preliminary testing with that code and it appears to work as expected. As per our private discussion, I'm opening a new GitHub issue (#505) to work on refactoring the codebase to make implementing this code a bit easier, as there are several places in the codebase where we need to look up the hostname. This GitHub issue is blocked until #505 is complete. |
Next Pro Release Changelog:
|
ZenCache Pro v150821 has been released and includes changes from this GitHub Issue. See the ZenCache Pro v150821 announcement for further details. This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#339). |
In a WordPress.org support thread, Andrew writes...
Referencing MU Domain Mapping plugin: https://wordpress.org/plugins/wordpress-mu-domain-mapping/
Support threads referencing this issue
The text was updated successfully, but these errors were encountered: