Mamba Cache Invalidation

Mamba automatically keeps your WooCommerce cache fresh so shoppers always see up-to-date products, prices, and availability. Instead of relying on blunt “clear all” purges, Mamba targets only the cache entries that are affected by a change and, when appropriate, immediately rebuilds them. This balance gives you accuracy without sacrificing performance.


What Invalidation Means

Invalidation is the act of removing stale cached pages as soon as content or catalog data changes. Mamba is precise: it clears only what’s necessary — the directly affected page and any related listings — rather than flushing the entire cache. This reduces server load and keeps the majority of your cache warm.

For example, if you update a product’s price, Mamba will clear that product page, the categories it appears in, and relevant storefront endpoints, but leave unrelated categories and products untouched.


When Invalidation Happens

Mamba listens for common WooCommerce and WordPress events that affect storefront content. Some examples include:

  • Product changes
    Edits to product content, pricing, or status. Stock changes (including variations and bulk updates). New products or product template changes in builders.
  • Catalog structure
    Updates to categories, tags, or product–category relationships.
  • Orders and sales
    New orders or order status changes that affect stock or availability. Start and end of scheduled sales.
  • Promotional mechanics
    Coupon creation or updates that influence pricing or catalog visibility.
  • Theme and navigation
    WooCommerce-related template updates in popular builders. Menu changes that affect storefront navigation.
  • Storefront endpoints (modern stack)
    Micro-purge of Store API responses on cart or checkout mutations, ensuring dynamic UIs always reflect current data.

In each case, Mamba clears the minimum viable set:

  • The directly affected product or category page.
  • Related listing pages (categories, tags, archives).
  • Key entry points like the shop and homepage when appropriate.
  • Dynamic data caches such as Store API fragments for cart and checkout.

What Re-Warm Means

After invalidation, Re-Warm ensures the next visitor still gets a cached HIT instead of waiting for a rebuild.

There are three ways re-warm can occur:

  • Context-aware, per-page
    From actions like “Purge & Warm This Page,” Mamba clears the cache for that page and immediately warms it along with closely related pages.
  • Automatic, broader warmup
    After batch operations such as product template edits or mass stock updates, Mamba schedules a safe warmup run covering the homepage, shop, top categories, and best-selling products.
  • Scheduled prioritization
    If enabled, a small “priority warmup” runs after daily cleanup to keep your most visited pages hot.

Re-warm follows the same safety rules as standard warmup. It never counts toward visitor statistics, never creates fake carts, and skips pages that declare “do not cache” (for example, private/no-store responses or those setting cookies).


What Gets Cleared vs. Re-Warmed

  • Precise page clear
    A product update clears its product page, category/tag listings, and key storefront pages if relevant.
  • Dynamic data clear
    Cart fragments and Store API entries are cleared on checkout/cart mutations to avoid stale UI.
  • Smart re-warm
    Cleared pages and their closely related contexts are immediately rebuilt, so shoppers continue to get a fast experience.

Best Practices

  • Use “Purge & Warm This Page” for spot fixes.
    A quick way to clear and rebuild a single product or category while working on it.
  • Rely on automatic re-warm after big changes.
    Mass edits and template changes automatically trigger broader warmup, no manual work needed.
  • Pair with your CDN.
    Align cache lifetimes so warmed pages remain hot at the edge.

Copyright 2025 - Mamba


Mamba mascot