A designer eyewear store on WooCommerce sells about 4,300 products from about 50 brands. When we started on its performance, the server needed 3.7 seconds before it sent the first byte of a page. Nothing could render, no image could start loading, and search engines measured the same delay on every crawl.
After a move to a dedicated server and a second cache layer, the store answers cached pages in about 0.3 seconds. Below is what slows WooCommerce down on a large catalogue, what we changed for this store, how we approach caching on stores like it, and a checklist for your own shop.
What we started with
We have worked with this store since 2023. It sells original sunglasses and frames online and in offline shops. The catalogue, stock and prices come from the client’s warehouse and accounting software, which also tracks stock in the offline shops. The client did not want to keep the online catalogue by hand, so the accounting side is the source of truth and the site follows it.
That integration shapes everything about caching. A model that sells out in a shop has to disappear from the site and come back when it is restocked. A discount set in accounting has to show up on the product page and in the SALE section without anyone touching the admin panel. So the store has two needs that pull against each other: pages must be fast, and stock and prices must stay current.
The store runs on WordPress with WooCommerce.
Where 3.7 seconds go in WooCommerce
TTFB, time to first byte, is the time between the browser sending a request and the server starting its answer. For an uncached WordPress page, that time covers the whole PHP run: loading WordPress core, every active plugin and the theme, running the database queries, building the page, and only then sending the first byte.
On a store with thousands of products the usual costs look like this:
- PHP has to start from scratch on every request. Without OPcache, PHP compiles every WordPress, WooCommerce and plugin file again for each page view.
- Every request asks the database the same questions. Without a persistent object cache, WordPress keeps its object cache only for the length of one request. Options, product metadata, taxonomy terms and menus get loaded from MySQL again on the next page view.
- Product queries grow with the catalogue. Category pages with filters, sorting and stock checks query product metadata, and that work grows as the catalogue grows.
- Page builders and heavy themes render on every view. Their layouts add processing to each uncached page.
- Shared hosting hides the real cost. On a shared plan, CPU and disk are split with other sites, so the same page can take a different time from one minute to the next.
Each of these is default WordPress behaviour, and on a large shop they add up to seconds.
What we changed for this store
Support for the store covers the accounting integration, performance, SEO and the move to a dedicated server. The performance change came in two steps: we moved the store to a dedicated server and added a second cache layer.
A dedicated server gives predictable CPU and memory, and control over the parts that hosting panels usually lock down: the PHP version and its settings, the web server configuration, and which services run next to the site. That control is what makes the caching setup below possible on any store.
How we approach caching on a large WooCommerce catalogue
The rest of this section is our general practice for WooCommerce stores, the list we work through on a server we control. It is not a line-by-line description of one client’s configuration.
Check OPcache first
OPcache keeps compiled PHP in memory. Check that it is on and has enough memory for the number of PHP files the site loads. A WordPress store with WooCommerce, a page builder and a dozen plugins loads thousands of files, and a cache that fills up starts evicting them and compiling again.
A persistent object cache
Redis or Memcached keeps WordPress objects in memory between requests. Product data, options and terms that one visitor caused WordPress to load are already there for the next visitor. This layer helps every request that reaches PHP, including the ones that can never be served from a page cache: the cart, checkout, the customer account, and anything a logged-in manager does in the admin panel.
The object cache does not remove the PHP run. WordPress still loads, plugins still execute, and the page builder still renders. It shortens the database part.
A full-page cache with store exceptions
The bigger step for anonymous visitors is a page cache, for example fastcgi_cache in nginx. nginx stores the finished HTML of a page and serves it to the next visitor without starting PHP at all. For a guest browsing a category or a product page, that skips the whole WordPress run described above.
On a store this layer needs exceptions, and getting them wrong is how shops end up showing someone else’s cart. Typical rules bypass the page cache for:
- requests other than GET and HEAD;
- the cart, checkout and account pages, and WooCommerce API endpoints;
- the admin area, the REST API and search requests;
- visitors with WooCommerce cart or session cookies, and logged-in users.
# simplified example: decide when not to use the page cache
set $skip_cache 0;
if ($request_method !~ ^(GET|HEAD)$) { set $skip_cache 1; }
if ($request_uri ~* "/(cart|checkout|my-account|wc-api|wp-admin|wp-json)") { set $skip_cache 1; }
if ($query_string ~* "(add-to-cart|(^|&)s=)") { set $skip_cache 1; }
if ($http_cookie ~* "(woocommerce_items_in_cart|wp_woocommerce_session_|wordpress_logged_in_)") { set $skip_cache 1; }
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
Purge and warm-up on a synced catalogue
A page cache that ignores stock changes undoes an accounting integration. When a product sells out or a discount changes, the cached copy of that page is out of date. The purge has to follow content changes, so the next visitor gets a page built from current data. A scheduled job that requests the main pages again after a purge keeps the first visitor from paying the full PHP cost.
This is the part that takes the most care on a synced catalogue. The cache rules, the purge triggers and the sync schedule have to agree with each other. Otherwise a sold-out model stays visible to guests until the cache expires.
The result
| Metric | Before | After |
|---|---|---|
| Server response (TTFB) | 3.7 s | about 0.3 s on cached pages |
| Products in the catalogue | about 4,300 | about 4,300 |
The catalogue did not shrink, and the sync with accounting kept running. Sold-out models hide themselves and return when restocked, with a “Back in stock” block on the home page. Discounts set in accounting appear in the SALE section on their own.
The 0.3 s figure is for pages served from cache. Pages that have to run PHP on every request are a separate measurement, and on any store they will be slower than cached ones.
If your shop runs on WooCommerce, see our WordPress and WooCommerce development page; for stores that sync with warehouse and accounting software, see ecommerce development. The store’s full case is on the designer eyewear store case page.
Checklist for a slow WooCommerce store
- Measure TTFB on its own. Use
curl -o /dev/null -s -w '%{time_starttransfer}\n' https://your-shop/or the Network tab in the browser. A slow TTFB is a server problem; images and scripts load after it. - Compare a guest and a logged-in user. If both are slow, there is no working page cache. If only logged-in users are slow, look at PHP, the database and the object cache.
- Check OPcache from the web, not from the command line. PHP CLI often reads a different configuration file. A
phpinfo()page behind a password, or the Site Health screen, shows what the web server uses. - Install a persistent object cache. Redis or Memcached, with a matching WordPress drop-in. Site Health can report when a persistent object cache is missing.
- Add a page cache with WooCommerce exceptions. Cart, checkout, account, API endpoints, and visitors with cart cookies must bypass it.
- Tie cache purges to stock and price changes. If your catalogue syncs from accounting or an ERP, test what a guest sees right after a product sells out.
- Warm the cache after a purge. A scheduled crawl of your main pages keeps the first visitor from waiting on a cold page.
- Watch for bots that skip the cache. Price scrapers and crawlers that hit search or REST URLs go straight to PHP and MySQL on every request. Check your access log for repeated uncached patterns.
- Look at hosting last, but look. On shared hosting you cannot tune PHP, the web server or Redis. Sometimes the move to a server you control is the change that makes the rest possible.
FAQ
What is a good TTFB for a WooCommerce store?
Google’s guidance for TTFB is 0.8 seconds or less at the 75th percentile as a rough target. A store serving cached pages can go well below that, as this one does at about 0.3 s. Pages that must run PHP, such as the cart and checkout, will be slower than cached pages, and the goal there is to keep them stable under load.
Does Redis alone fix slow TTFB?
Redis object cache shortens the database part of each request. WordPress, WooCommerce, plugins and the page builder still run on every view. On a large store the biggest drop for guests usually comes from a full-page cache that skips PHP. The two layers solve different problems, so we recommend both.
Will a page cache show wrong stock or prices?
It can, if purges are not tied to product changes. The cached HTML stays as it was until something clears it or it expires. On a store whose stock and prices come from accounting software, the purge has to follow the sync, and it is worth testing by selling out a product and loading its page as a guest.
Do we need a dedicated server for a store with a few thousand products?
Not always. Many stores of this size run well on a good managed host with OPcache, Redis and a page cache available. A dedicated server makes sense when the host does not let you configure those parts, or when you share CPU with other sites and response times jump without a pattern. For this store, the move to a dedicated server went together with a second cache layer.
What would you like to do next?
Discuss a project
Tell us about the task. Within one working day we reply with questions or a first view on scope and cost.
Start a projectAsk a question
A short question about your app, website or idea. An engineer replies by email.
Get new articles
New articles and case studies by email, no more than once a month. Unsubscribe at any time.