Sandi Verdev

Case study

WooCommerce product pages served from cache: from 1 in 5 to almost 9 in 10

WooCommerce shop · macjamati.si ↗ · Oct – Nov 2026

Problem

Product pages on macjamati.si were slow. An uncached product page took about 4 s to fully load, a cached one about 0.5 s, and only about a fifth of product views came from the cache.

PHP wasn't the main problem. Every order, stock change or product edit cleared all of the 440 or so product pages at once, because they shared one cache tag.

What I did

  • Measured before changing anything: I replayed a month of real access logs against the real stock changes and edits, to compare cache rules before building one.
  • Precise purging: a product's own page clears when it changes; other pages only when a product they show sells out, comes back or is edited. Prices and stock stay correct.
  • Stopped an hourly product-feed export from clearing the homepage and all pages, about 900 times a month.
  • Turned the cache crawler back on and set a 12-hour interval after comparing 3.5 days, 1 day, 12 and 6 hours in the replay.
  • Left scrapers alone: the replay showed they refill the cache for customers.

Result

Cache results before and afterProduct views served from cache rose from 21–22% to 86–90%. Average wait before a product page starts loading fell from 1.91 seconds to 0.26–0.37 seconds. Same real traffic replayed under both setups.Product views served from cache0%25%50%75%100%Before21–22%After86–90%Average wait before a product page starts loading0 s0.5 s1 s1.5 s2 sBefore1.91 sAfter0.26–0.37 s
The same real traffic (31 Oct – 6 Nov 2026) replayed under the old and new setup.

Load times (same 16 product pages, headless Chromium, medians, 24 Oct vs 11 Nov 2026): cached 0.48 → 0.27 s, uncached 4.0 → 3.3 s, and most views now get the cached page. The 86–90% is a replay estimate, since visitor cache hits aren't logged; the crawler's own production checks back it up: 85–100% of product pages were still cached after 12 hours of orders.

Stack

  • WordPress
  • WooCommerce
  • LiteSpeed Cache
  • PHP (child theme)
  • Python (log replay)