• Resolved pepe80

    (@pepe80)


    Hi,
    I have multisite (subdomains) with domain mapping:
    site.com -> subdomain.mysite.com

    I see two directories in the cache directory:
    /cache/page_enhanced/subdomain.mysite.com
    /cache/page_enhanced/site.com

    When I update a post in the admin panel:
    subdomain.mysite.com/wp-admin/post.php?post=2778&action=edit

    ..cache is only cleaned in the directory:
    /cache/page_enhanced/subdomain.mysite.com/…

    but it’s not cleaned here:
    /cache/page_enhanced/site.com/…

    Please help.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @pepe80

    Thank you for your inquiry and I am happy to assist you with this.
    Please go to Performance>Page Cache, Aliases sub-box, and add that domain in Additional home URLs: field, save all settings and purge the cache.
    See if the issue persists.
    Thank you!

    Thread Starter pepe80

    (@pepe80)

    Can I set these options in one place: network admin? If i have to unchecked the option:
    “Use single network configuration file for all sites.”
    …then I must solve this problem first:
    https://www.ads-software.com/support/topic/multisite-separate-configuration-does-not-work/
    ??

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @pepe80

    Yes, you can set it on your main website.
    Does the issue persist when you add the URL to aliases?
    Thanks!

    Thread Starter pepe80

    (@pepe80)

    The problem still persist. Here is the bigger picture of the site structure:

    Main site: mysite.com
    Here I never have an issue with cache purge.

    Other sites (subdomain -> domain mapping):
    subdomain1.mysite.com -> site1.com
    subdomain2.mysite.com -> site2.com

    Here I have problem with cache purge after post update (or click: Performance -> Purge Modules -> Page Cache: Current Page).

    In “/cache/page_enhanced/” folder i see:
    mysite.com – no problem
    site1.com – problem
    site2.com – problem
    subdomain1.mysite.com – no problem
    subdomain2.mysite.com – no problem

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @pepe80

    Thank you for the information.
    Just to confirm, the issue occurs if you use Purge Current Page?
    Does the issue persist if you purge all cache?
    Thanks!

    Thread Starter pepe80

    (@pepe80)

    Purge All Caches – works fine
    Purge Current Page – does not work

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @pepe80

    The Purge Current Page is based on post_id=
    In your case, the post_id is not the same so you should use Purge all caches in this case.
    Thank you!

    Thread Starter pepe80

    (@pepe80)

    Hi Marko,
    sorry but I don’t understand. I’m an advanced programmer so you can use technical language ??

    I’m on the post editing page:
    /wp-admin/post.php?post=2778&action=edit&lang=lt

    Link to “Purge Current Page” looks like this:
    /wp-admin/admin.php?page=w3tc_dashboard&w3tc_flush_post&post_id=2778&_wpnonce=e63aea3956

    So… post_id is the same: 2778. Under “Title” input I see url:
    https://subdomain1.mysite.com/somepage
    Cache is not cleaned in the directory:
    /cache/page_enhanced/site1.com/somepage/

    • This reply was modified 4 years, 6 months ago by pepe80.
    Thread Starter pepe80

    (@pepe80)

    The question is: does your plugin support domain mapping?
    https://www.ads-software.com/plugins/wordpress-mu-domain-mapping

    WordPress Multisite Domain Mapping

    • This reply was modified 4 years, 6 months ago by pepe80.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @pepe80

    Ah I see. Thank you for the explanation.
    Domain mapping is not core wp functionality and not supported directly.
    You can purge alternative URLs using mirror option Performance>Page cache>Aliases
    Thank you!

    Thread Starter pepe80

    (@pepe80)

    Ok, in that case, I have to wait for this problem to be resolved:
    https://www.ads-software.com/support/topic/multisite-separate-configuration-does-not-work/

    Thread Starter pepe80

    (@pepe80)

    Before WordPress 4.5, domain mapping requires a domain mapping plugin like WordPress MU Domain Mapping. In WordPress 4.5+, domain mapping is a native feature.

    Thread Starter pepe80

    (@pepe80)

    Hi @vmarko,
    unfortunately, the problem still occurs. Let me remind you how my multisite looks like:

    Main site: mysite.com
    Here I never have an issue with cache purge.

    Other sites (subdomain <- domain mapping):
    subdomain1.mysite.com <- site1.com
    subdomain2.mysite.com <- site2.com

    In the admin panel I switch to the website:
    subdomain1.mysite.com

    I set the option Performance > Page cache > Aliases:
    https://pasteboard.co/Ja0QeG5.png
    I have tried:
    https://site1.com
    https://site1.com
    site1.com

    When I update a post (or use “Purge Current Page”) cache it’s not cleaned here:
    /cache/page_enhanced/site1.com/…

    • This reply was modified 4 years, 6 months ago by pepe80.
    • This reply was modified 4 years, 6 months ago by pepe80.
    Thread Starter pepe80

    (@pepe80)

    I can see where the problem is:
    \plugins\w3-total-cache\Util_PageUrls.php

    	static public function complement_with_mirror_urls( $queued_urls ) {
    		$config = Dispatcher::config();
    
    		if ( !$config->get_boolean( 'pgcache.mirrors.enabled' ) ||
    			Util_Environment::is_wpmu_subdomain() )
    			return $queued_urls;
    
    		$home_urls = $config->get_array( 'pgcache.mirrors.home_urls' );
    

    This function:
    Util_Environment::is_wpmu_subdomain()

    …returns true because i have multisite “subdomain install”:
    define('SUBDOMAIN_INSTALL', true);

    Why in this case you interrupt further processing in complement_with_mirror_urls() function and don’t get values from an aliases array?
    If I comment this condition, everything starts working properly and the cache is cleared.

    Thread Starter pepe80

    (@pepe80)

    Hi @vmarko,
    I see that the topic is marked as “Resolved”. Should I create a new topic?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Multisite with domain mapping and purge cache after post update’ is closed to new replies.