A slow WooCommerce store bleeds revenue. Studies consistently show that a 1-second delay in page load reduces conversions by 7%. We recently took a client’s store from a 3.2-second Time to First Byte to under 0.8 seconds using the techniques below — with zero infrastructure upgrades.
WordPress makes hundreds of database queries per page by default. Redis object caching stores query results in memory, dramatically reducing database load.
# Install Redis server (Ubuntu)
sudo apt install redis-server
# Install the Redis plugin
wp plugin install redis-cache --activate
# Add to wp-config.php
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
# Enable drop-in
wp redis enable
On our test store, enabling Redis reduced page generation time by 62% alone.
Cart, checkout, and account pages must never be cached. Configure your caching plugin to exclude these URLs:
# Nginx FastCGI cache exclusions
set $skip_cache 0;
if ($request_uri ~* "/(cart|checkout|my-account|wp-admin)") {
set $skip_cache 1;
}
if ($http_cookie ~* "woocommerce_items_in_cart|wordpress_logged_in") {
set $skip_cache 1;
}
WooCommerce’s default product loops load unnecessary postmeta. Use woocommerce_product_query to strip it down:
add_action('woocommerce_product_query', function ($q) {
$q->set('fields', 'ids'); // fetch IDs only
$q->set('no_found_rows', false); // keep for pagination
$q->set('update_post_meta_cache', false);
$q->set('update_post_term_cache', false);
});
add_filter('wp_lazy_loading_enabled', '__return_true');width and height on all product images to prevent layout shift (CLS)Each active plugin adds PHP execution time and potentially extra database queries. Audit your plugins with Query Monitor — look for anything adding 10+ queries per page or taking 50ms+ of execution time.
# Remove orphaned postmeta
DELETE pm FROM wp_postmeta pm
LEFT JOIN wp_posts p ON p.ID = pm.post_id
WHERE p.ID IS NULL;
# Clean up expired transients
DELETE FROM wp_options
WHERE option_name LIKE '_transient_%'
AND option_value < UNIX_TIMESTAMP();
# Optimise tables
OPTIMIZE TABLE wp_options, wp_postmeta, wp_posts;
Applying all six techniques to our client’s store (a 4,000-product WooCommerce catalogue):
Performance is a feature. Invest in it before you invest in more traffic.