Hosting Services

How to Make WooCommerce Fast on a VPS: Caching, Redis, Real Cron and HPOS

Boost your WooCommerce store’s speed and efficiency with these VPS optimization techniques.

Short answer: On a VPS, a fast WooCommerce store needs: a current PHP version with OPcache, page caching that skips cart, checkout and account pages, a Redis object cache, WooCommerce’s High-Performance Order Storage (HPOS), and WP-Cron replaced by a real server cron job. Add a CDN for images, keep plugins lean, and load-test before big sales.

Size the VPS

Store Starting point
New or small store 2 vCPU, 4 GB RAM, NVMe storage
Busy store, regular campaigns 4 vCPU, 8 GB RAM
Large catalogue or heavy traffic 8 vCPU or more, 16 GB RAM, possibly a separate database server

Logged-in shoppers and checkout pages cannot be fully cached, so a store needs more resources than a blog with the same number of visitors.

Step 1: PHP

  • Use the newest PHP version that WooCommerce and your plugins support.
  • Make sure OPcache is on, with enough memory for all your plugins (256 MB is a good start).
  • Set memory_limit to 256M or 512M for the store.
  • Give PHP-FPM enough processes for your traffic, without exceeding the RAM.

See our PHP optimisation guide for the settings.

Step 2: page caching with the right exclusions

Use a page cache plugin or server cache, but never cache pages that differ per customer:

/cart/
/checkout/
/my-account/
# and any request with the woocommerce_items_in_cart or wp_woocommerce_session_ cookies

Most WooCommerce-aware caching plugins add these exclusions automatically. Check them after setup by adding a product to the cart in a private window.

Step 3: Redis object cache

WooCommerce runs many repeated database queries. An object cache keeps their results in memory. Install Redis on the VPS, then a Redis object cache plugin, and enable it:

dnf install -y redis        # or: apt install -y redis-server
systemctl enable --now redis
wp plugin install redis-cache --activate
wp redis enable

On cPanel servers, Redis Manager gives each account its own Redis instance.

Step 4: turn on High-Performance Order Storage (HPOS)

HPOS stores orders in dedicated database tables instead of the general posts tables, which makes order queries much faster on busy stores. New stores use it by default. On older stores, check WooCommerce > Settings > Advanced > Features, make sure your plugins are compatible, sync the data, then switch.

Step 5: replace WP-Cron with a real cron job

WP-Cron runs scheduled tasks during page visits, which slows visitors down and is unreliable on quiet stores. Turn it off and run it from the server instead:

// wp-config.php
define( 'DISABLE_WP_CRON', true );

# crontab -e (as the site's user): every 5 minutes
*/5 * * * * cd /path/to/site && wp cron event run --due-now >/dev/null 2>&1

Also check Tools > Scheduled Actions for thousands of old completed or failed actions; clearing them keeps the database lean.

Step 6: images, CSS and a CDN

  • Serve product images as WebP or AVIF at the sizes your theme shows, with lazy loading below the first screen.
  • Turn on Brotli or Gzip compression on the web server.
  • Use a CDN for images and static files. See our CDN guide.

Step 7: keep plugins lean

Every plugin adds code to every request. Remove unused plugins, replace heavy ones, and watch the number of database queries per page with a query monitoring plugin on a staging copy.

Step 8: security and payments

  • ✓ Use your payment provider’s hosted payment fields, so card data never touches the server.
  • ✓ Keep WordPress, WooCommerce and plugins updated, testing big updates on staging first.
  • ✓ Use two-factor authentication for admins and limit login attempts.
  • ✓ Put a WAF and rate limits in front of login and checkout pages.
  • ✓ Keep daily off-server backups of files and database.

Step 9: test before big sales

Load-test a copy of the store with realistic traffic, including add-to-cart and checkout, before Black Friday or a campaign. Watch CPU, memory, PHP-FPM and database load, and scale the VPS before the event, not during it.

Need help with this?

Running WooCommerce? A Cloud VPS gives your store dedicated resources, with our team on hand to tune it.

See Cloud VPS plansContact @CustomerPanel

Frequently asked questions

How much RAM does a WooCommerce store need?

Start with 4 GB for a small store, and 8 GB or more for a busy one.

Which pages should never be cached in WooCommerce?

Cart, checkout and my-account, and any request from a shopper with items in the cart.

What is HPOS in WooCommerce?

High-Performance Order Storage keeps orders in their own tables, making order queries faster. New stores use it by default.

Why disable WP-Cron?

It runs during page visits. A real cron job runs scheduled tasks on time without slowing visitors down.

Does Redis help WooCommerce?

Yes. A Redis object cache reduces repeated database queries, which speeds up shop and admin pages.


Sources