8

We are very happy to announce a first beta of WPML 3.1.9, which works great with object caching. If you are looking for significantly better performance for big sites with many strings, this is for you.

WPML’s String Translation does a very important function, allowing you to translate strings without having to go through .mo files. This is especially important for dynamic strings, which are created in the database and not stored in PHP code.

WPML 3.1.9 is the first step towards a massive performance improvement. In this step, we allow object caching plugins to catch repeating accesses and eliminate them. We experimented with different caching techniques and eventually settled on the best performer – ‘no caching in WPML’. This might be a bit surprising, but it actually makes sense. Caching plugins try to group operations and store them in memory as bigger and faster chunks. When WPML tried to cache strings itself, it caused the object caching to be useless.

In this release, we’ve cleaned up our caching completely, optimized our database access and made everything accessible to object caching. This helps simplify our logic (less PHP processing, less chances of glitches) and it also allows object caching to do its job.

Many sites will barely see the performance improvement because the String Translation’s load wasn’t a huge part of the overall page load. Some sites that have a lot of strings will see a significant improvement. Even without object caching, they should already have far fewer database queries. And, they have a potential to see yet greater improvement by enabling object caching.

How to Enable Object Caching with W3TC

Object caching takes a bit of planning and setup. Here is an inventory list of the elements you’ll need:

  • An opcache PHP plugin (not to be confused with a WordPress plugin)
    • For PHP < 5.5 => use APC, set enough memory (128MB+ for larger sites( WCML mostly ) are a good idea), in production set apc.stat active
      • Users who know what they’re doing could also try to exclude sitepress.class and other very large files of ours from APC, this could bring considerable gains
      • Install via pecl
    • For PHP >= 5.5 => use ZendOpcache, it’s currently faster and much easier to configure
      • install via pecl or during compilation of PHP
  • In W3TC itself
    • Select your used OpCache plugin for the various caching options ( Database, Object etc..), Don’t use Harddrive here anywhere!
    • Careful with the gZip settings for the output ( this seems to rather slow things down unless you have a strong CPU)
  • PHP configuration:
    • Set enough RAM
    • Activate the PHP query cache ( not strictly related to W3TC, but it helps a ton in some spots)
  • MySQL configuration:
    • If you don’t have any tricky memcached setup => try the MySQL query cache, it should provide significant gains especially with the new ST

Download and Try WPML 3.1.9

As this is a beta version, you need to download it manually. Log in to your WPML.org account and click on Downloads.

Scroll all the way to the bottom and get the CMS Beta Package. This is a ZIP that includes other ZIPs. Unzip it locally. Now, you can either upload the ZIP files to WordPress (which will extract them), or extract yourself and save in the plugins folder.

Questions? Suggestions? Ideas? Leave your comments and we’ll get back to you.

8 Responses to “WPML 3.1.9 Beta Supports Object Caching”

  1. A faster WPML is great news, thanks for looking into these optimisations.

    Have you tested WPML 3.1.9 beta with the currency switcher from aelia? I was using W3Total cache before but noticed that woocommerce would no longer show geo-located prices, and instead would show cached prices in the currency used during the last cached visit. So in the end I stopped using any caching with WPML.

    Hopefully this new version will not make performance worse if we can’t use W3total cache.

    Thanks

  2. actually this is great news, because i am experience a very low performance since 2 days because of string translation module. But my question is this:
    i already have WPML installed on my live website, so how would i update it to the new beta, and would you recommend i install it on a live website directly?

    • We are not running beta versions of anything on our production sites and I don’t recommend anyone to do it also. Did you add WPML to your site 2 days ago?

      • no WPML is installed and functional for one month one. but these last two days i started to experience very low performance. i ran a whole checkup on all the plugins and it turned out that string module was running about 10 php process simultaneously. “auto registration and string tracking” both deactivated and still the same issue. that’s why i was encouraged to use this beta.
        i created .mo files of all my content translations and switched to translation via .mo, php pro decreased but it seamed that string module was always generating requests.