Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi jmcollin92,

    Are you referring to the same site but with different languages that’s switched by using on of the multilingual plugins, if so can you tell me which multilingual plugin are you using?

    Or you have two sites, one on English and one on different language that’s having issues with W3TC?

    Cheers,
    Predrag

    Try using autoptimize to handle the minifying of your CSS and JavaScript. It will resolve this issue when you tweak it.

    Thread Starter jmcollin92

    (@jmcollin92)

    Yes I’m refering to the same site but with a different language. I’m using https://fr.www.ads-software.com/plugins/multisite-language-switcher/ plugin.

    @destac I don’t any autoptimize option ?

    JM.

    Hi jmcollin92,

    I just checked W3TC with this plugin on my installation and couldn’t replicate the same issue.
    Do you perhaps have some additional steps I could follow to try replicating this?

    Cheers,
    Predrag

    I had the same issue. The problem is that W3 cache’s the base url. So if you are using https://www.yoursite.com for one and uk.yoursite.com for the other site you get issues. I fixed it by updating code in W3. I updated the function w3_get_home_url() to always use get_home_url() instead of looking up the cache. The function is in /w3-total-cache/inc/define.php The issue I had was the CDN. Because W3 uses the function below to match and replace. So what would happen is when I went to uk.site.com I would get uk.site.com/www.site.com/css/styles.css

    This is my modified function:

    function w3_get_home_url() {
    static $home_url = null;
    //Added this line to always set the home_url
    $home_url = get_home_url();
    if ($home_url === null) {
    $config = w3_instance(‘W3_Config’);
    if (w3_is_multisite() && $config->get_boolean(‘common.force_master’)) {
    $home_url = get_home_url();
    } else {
    // This is the problem here
    $home_url = $config->get_cache_option(‘wordpress.home’);
    $home_url = rtrim($home_url, ‘/’);
    }
    }

    return $home_url;
    }

    Wow tomcat90, that’s awesome, thanks for sharing!

    Cheers,
    Predrag

    Thread Starter jmcollin92

    (@jmcollin92)

    Thank’s Tomcat90. I will try this waiting for a patch.

    Thread Starter jmcollin92

    (@jmcollin92)

    The release 0.9.5.1 have solved definitively this issue.
    Thank’s for all !

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘W3 Total Cache don't work for multilang WordPress Site’ is closed to new replies.