WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] W3TC and WordPress multi-site (14 posts)

  1. miraiespana
    Member
    Posted 3 years ago #

    Hi everyone,

    Been using W3TC plugin with wordpress 3.x without a problem. It works great in fact (good work W3TC team).

    However, when we try to install it in a WordPress 3.0.1 + multi-site (old wordpress-mu) + domain Mapping (not sub-directories) .. we're having problems.

    I've been searching and have found several posts saying thinks like you need specific configuration, others that you have to enable the plugin in all your sites in order to "fully utilize w3tc", or that you have to have subdirectories mode set (that it does not work with domain mapping).

    However, in many other posts we also found people saying (or replying) that W3TC works fine "as is" with WordPress 3.x + multisite + domain mapping. Can anybody confirm so please?

    If that's the case, we're doing something wrong as we added the pluging, and activated in one of the sites (not all of them) ... we added the necessary lines in the .htaccess file (the documentroot one, common for all sites). WordPress does not complain something is missing, but no cache whatsoever (we're trying to use page cache). No files found in the wp-content/xxxx/pgcache directory.

    Any clue?

    Questions we have that could be related to our problem.

    - We are using domain mapping with this configuration

    Remote Login ON
    Permanent redirect OFF
    User domain mapping page ON
    Redirect administration pages to site's original domain ON
    Disable primary domain check OFF

    Should I change anything?

    - After installing the plugin, I CANNOT activate for all the network, and I have to do so one by one. Is this ok?

    - Do I need to activate the plugin in ALL my sites (I host around 60) in order to make it cache files to file-system?

    - Should I except the cache files (starting with "_") to be in the pgcache directory? (as it does in the single installation of wordpress+w3tc)?

    - As I understand, I'm only updating the .htaccess in the documentroot of my server. Should I have more .htaccess files in the wp-content/xxx directories?

    Well, sorry for this long post. Hope somebody can confirm W3TC works out of the box, and if so, shed some light on my problem!

    Thanks for your help

  2. Celinal
    Member
    Posted 3 years ago #

    I was wondering the same. Some say it works as is, some say it is not..blah blah blah. So confused. I am currently using Quick Cache since it is working for multisite installs and has only one setup for the entire network, but would rather switch back to W3TC which has more options and speed things up very well. Oh, I wish W3TC can have this config in multisite admin as well.

    Does anyone have this fully working for a multisite?

    Thanks

  3. robnalexpress
    Member
    Posted 3 years ago #

    I have been using W3TC with my multisite + domain mapping for a long time. It works just fine. There may be some issues with WordPress 3.1 which is why I'm still on 3.0.5 until the next W3TC update. Here are some basics I've learned about using W3TC on multisite:

    > It really doesn't do much unless it's activated on ALL sites.

    > It must not be network activated, but activated individually on each site.

    > The W3TC settings must be IDENTICAL for each site since all sites share the same htaccess file.

    At one time I had 3 sites all humming along just fine using W3TC + domain mapping, but now I have 2. You can see them in action here and here.

  4. miraiespana
    Member
    Posted 3 years ago #

    Thanks Celina and robnalexpress for your reponses.

    @robnalexpress, quick questions about your installation

    - Are you using "page cache". If so, are cached files (starting with "_") being stored in the pgcache directory? where exactly? under w3tc-xxxxx/pgcache where xxx is the internal name of your site?

    - How many .htaccess files do you have? Did you have to add the special lines in the document root .htaccess file or you had to create more files under different directories?

    Thanks a lot for your help.

  5. robnalexpress
    Member
    Posted 3 years ago #

    @miraiespana-

    Yes, using page cache- files are at /public_html/wp-content/w3tc-xxxx.com/pgcache. There is a htaccess file in the pgcache folder for each site in addition to the htaccess file in the root directory. When changes are made to the W3TC configuration or when I temporarily disable and re-activate the plugin it's is necessary to copy the necessary code, usually for browser cache, into the root htaccess. file.

  6. miraiespana
    Member
    Posted 3 years ago #

    @robnalexpress, thanks for your response again.

    So you will have n+1 .htaccess files (one for the root directory and one for each site). And you need to copy the content manually or does the plugin do it for you? I mean, what if you do not have access to the file system as you are working only through the WP interface?

    Last question about .htaccess ... you mention that you need to copy the "browser cache" config to the .htaccess, but how about the "page cache" config. Do you need to copy it to each .htaccess as well or only to the documentroot file? According to the "plugin interface" when I install it, it says I need to copy it to the root .htaccess. Unfortuantely when I do so nothing happens.

    I'm not testing the browser cache yet. My problem is with the "page cache" as files are not being generated under each pgcache directory.

    Thanks again for your help and support

  7. robnalexpress
    Member
    Posted 3 years ago #

    @miraiespana- I don't see how you can effectively use this plugin without some kind of access to the file system since the rewrite rules/code does need to be there, and occasionally updated.You can find the instructions and code through the WordPress/Performance/Install.

  8. miraiespana
    Member
    Posted 3 years ago #

    Hi robnalexpress, thanks for your quick response again.

    I do have access to the file system, but I would like the design team, who does not have access to the file system, to enable/disable the W3TC plugin. If they need to ask me for some changes in each individual .htaccess file ... it would be pretty slow. I know other plugins manage .htaccess changes by themselves. But anyway .. I can deal with it.

    Anyway, what I still do not have very clear is where I should put the "page cache" configuration changes: (a) in the .htaccess file in the document root or (b) in each individual .htaccess files (under pgacache/ dirs). I'm adding them to the document root file but no cached files are being generated in the pgcache dir. The plugin says it's properly configured, but it's not caching anything and it always access to the database.

    Thanks again for your help

  9. robnalexpress
    Member
    Posted 3 years ago #

    @miraiespana- The instructions under Performance/Install Rewrite rules seem pretty clear:

    /home/XXXX/public_html/.htaccess:
    # BEGIN W3TC Page Cache
    (code Follows)

    /home/XXXX/public_html/wp-content/w3tc-XXXX.com/pgcache/.htaccess:
    # BEGIN W3TC Page Cache
    (code follows)

    If this is still unclear to you perhaps Fredrick or someone else can explain it better.

  10. miraiespana
    Member
    Posted 3 years ago #

    Thanks robnalexpress. I'll do more testing then.

    So far, I haven't work that much with .haccess individual files under pgache dirs. The plugin never told me there were missing lines in these files. It did notice me, however, the changes in the document root .htaccess file were missing.

  11. robnalexpress
    Member
    Posted 3 years ago #

    @miraiespana- I'm not sure what you mean by "no cached files are being generated in the pgcache dir" What exactly are you looking for there? I just checked my pgcache directory and I don't see a file for every page. I'm not sure what you're looking for there. When you look at the source code for a page on your site, do you see something like this at the bottom:

    <!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

    Minified using disk
    Page Caching using disk (enhanced)
    Database Caching using disk
    Object Caching 1594/1603 objects using disk
    Content Delivery Network via XXX.XXX.com

    Served from: XXX.com @ 2011-03-22 17:41:52 -->

    If so, I think you can be assured that Page Caching is working.

  12. miraiespana
    Member
    Posted 3 years ago #

    Not sure I checked that. What I did was some jmeter tests and realized there was no improvement whatsoever.
    In the apache logs I also checked that the response time was the same as before (when there was no cache).

    In individual installations (not multisite), I realized the WT3C plugin created cached pages in the wp-content/w3tc/pgcache dir. All files where being cached there with the prefix _. Example

    _index.html
    _index.html.gzip

    As I understand, wordpress would use either the gzip version or the normal one depending on the http-header of the request.

    Jmeter response times and apache log files showed 80% improvement when using W3TC plugin. If I delete the pgcache/* files, the first request goes to database and lasts much longer.

    This is why I'm focusing in the cached files generation.

  13. Jon Breitenbucher
    Member
    Posted 2 years ago #

    @robnalexpress

    The issue I have is that the part that goes in /home/XXXX/public_html/.htaccess is basically the same on each site. So I have Multisite enabled and and in the /home/XXXX/public_html/.htaccess I am supposed to have RewriteCond %{HTTP_HOST} =mysite.tld for the main site of the Multisite install. Then for a mapped subdomain of the mysite.tld at mysite2.tld I am supposed to have RewriteCond %{HTTP_HOST} =mysite2.tld but the rest of the codeblock is identical to the one for mysite.tld. So do I just have two page cache block in /home/XXXX/public_html/.htaccess or what?

  14. robnalexpress
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic