WooCommerce has unique caching requirements — cart and checkout must not be cached. This guide covers optimising the full stack for WooCommerce.
Nginx Cache Rules for WooCommerce
set $skip_cache 0;
if ($request_uri ~* "(/cart|/checkout|/my-account)") {
set $skip_cache 1;
}
if ($http_cookie ~* "woocommerce_cart_hash|woocommerce_items_in_cart|wp_woocommerce_session") {
set $skip_cache 1;
}
if ($http_cookie ~* "wordpress_logged_in") {
set $skip_cache 1;
}
Database Optimisation
wp transient delete --expired
wp wc tool run clear_transients
PHP Configuration
memory_limit = 512M
max_execution_time = 300
Conclusion
WooCommerce performance tuning requires balancing caching with cart functionality. Our team optimises WooCommerce server performance for high-traffic stores.
Comments