If your hosting provides it, you can use Redis to enable persistent caching for your WPML-powered website.
In 2019, the WPML team made many improvements in the code to make WPML faster and more convenient to use. Some of these improvements can be seen when persistent object cache is enabled.
What is a persistent cache?
In WordPress, almost all items are cached to provide better performance. When a theme or plugin makes multiple requests to data like posts, all data are saved in memory to prevent further requests to the database and make code faster. By default, cached data is stored in memory for the duration of a single page load. So, the cache is not persistent, and on the second request, everything repeats – new calls to the database to retrieve the information, then using the cache in memory.
Things change when we start to use persistent cache solutions like Redis or Memcached. These products, which are installed on the server by a hosting provider, allow storing cache data between page loads, which makes WP and WPML significantly faster. To use this kind of server software, WordPress needs special addons or a plugin.
Enabling Redis on your site
Redis is the most popular server persistent cache software nowadays. To be able to use it, your hosting provider must enable it on the server.
The easiest way to use it is to install the Redis Object Cache plugin by Till Krüss.
After activation, go to the Settings → Redis page and click the Enable Object Cache button. And that’s it!
Other persistent cache solutions
Alternatively, you can use Memcached. You can read our guide for manually setting up Memcached on your site. It requires a little PHP knowledge.
We wrote that guide because almost all Memcached-related plugins on WordPress.org repository are outdated so we cannot recommend them. The exception is the W3 Total Cache plugin, which supports Memcached out-of-the-box.