wordpress

WordPress Transients: Back to basics for performance optimisation

It can be easy to overlook or be unaware of basic site optimisation techniques. However, any site optimisation strategy should look at every available option.

Most WordPress developers will be aware of the ‘wp_options’ table, for storage of plugin data for example. WordPress also has built-in functions that cater for the storage of time-limited or ‘transient’ data.

WordPress Transients are a great way to store the results of resource heavy queries or processes. WordPress’ database structure can often lead to inefficient database queries, especially at scale where the blog holds many thousands of posts.

The storage of the results of these inefficient queries into a WordPress Transient can massively reduce the processing load required to render a page.

WordPress Transients: Back to basics for performance optimisation

Even if a relatively short expiry period is used, the performance effect on a well-trafficked site can be significant.

In a clustered WordPress environment, the benefits are even greater; massively reducing the underlying processing power and memory requirements under load.

Although transient data is stored in the ‘wp_options’ table by default, they should never be directly accessed via a database query. Instead, they should be accessed via the simple API that is part of the WordPress core.

The simple addition of an API to get and set transient data means that additional performance can be gained by storing transients via in-memory cache solutions, such as Memcached. Through the use of plugins such as W3 Total Cache, it’s a relatively trivial task to offload all of the transient processing from the database.

The net result of employing a strategy which includes the considered use of WordPress Transients can massively reduce server load and rendering times and ultimately results in a site that can cope with large spikes in traffic load.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>