WooCommerce

WooCommerce Performance: From 3s to 0.8s Load Time

dev.prakah2011 April 10, 2025 3 min read
🛒

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.

1. Enable Object Caching with Redis

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.

2. WooCommerce-Specific Caching Rules

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;
}

3. Optimise the Product Query

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);
});

4. Image Optimisation Pipeline

  • Install Imagify or ShortPixel to auto-convert uploads to WebP
  • Enable lazy loading: add_filter('wp_lazy_loading_enabled', '__return_true');
  • Set explicit width and height on all product images to prevent layout shift (CLS)
  • Use a CDN (Cloudflare, BunnyCDN) to serve images from edge nodes near your customers

5. Reduce Plugin Bloat

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.

6. Database Maintenance

# 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;

Results

Applying all six techniques to our client’s store (a 4,000-product WooCommerce catalogue):

  • TTFB: 980ms → 210ms
  • LCP: 3.2s → 0.8s
  • Conversion rate: +18% over 30 days
  • Google PageSpeed: 34 → 91

Performance is a feature. Invest in it before you invest in more traffic.

dev.prakah2011
dev.prakah2011

Developer & author at DevForge Agency.