Skip Navigation
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.

How can we make WPML better for you?

Share your thoughts and comments about our plugin, documentation, or videos by booking a Zoom call with Agnes, our Client Advocate. Your feedback matters and helps us improve.

Book a call with Agnes