Mamba Cache Warmup

Mamba’s warmup feature ensures your store is lightning fast for every visitor by prebuilding the cache before real shoppers arrive. Instead of waiting for the first user to generate cached versions of your pages, Mamba crawls your storefront in the background and stores ready-to-serve files. The result: instant page loads from the very first hit.

Warmup is not just about speed, but also about accuracy. It prepares the same variants your shoppers actually see — separate caches for desktop and mobile, multiple languages, different currencies, and, where applicable, geolocation and tax display settings. This guarantees that the first visitor in each segment receives the correct version of the page without delay.


What Warmup Covers

When triggered, Mamba warmup focuses on high-value storefront pages that drive conversions:

  • The homepage and shop archive
  • Top categories and tags
  • Individual product pages
  • Store API endpoints required by WooCommerce’s frontend

If warmup is initiated from a specific page, Mamba automatically includes closely related pages (for example, the product’s category and related products) to keep the immediate browsing experience smooth.

To avoid runaway jobs, warmup includes built-in caps. By default, only the variants your store actually uses are built. A multilingual, multi-currency store may see several versions per page, while a simple single-language, single-currency site will remain lean and fast.


When Warmup Runs

Warmup can be initiated in three ways:

  1. Automatically after content changes.
    When you update products, variations, prices, coupons, or menus, Mamba invalidates the relevant cache files and schedules a warmup to rebuild them.
  2. On demand from the admin.
    The Mamba header includes a one-click “Warmup” button. Individual pages also offer actions such as “Warmup This Page” or “Purge & Warm This Page.”
  3. As part of daily maintenance.
    If enabled, Priority Warmup runs shortly after scheduled cache cleanup. This keeps your homepage, shop, and top categories pre-cached and hot throughout the day.

How Warmup Works

Warmup runs safely in the background. Each request is tagged with the header X-Mamba-Warmup: 1 and a Mamba Cache Warmup Bot user agent. This tells Mamba to treat the request specially:

  • It does not count toward visitor cache statistics. Warmup requests are excluded from hit/miss charts.
  • It never appears to have a cart. Rules that normally block cache for users with items in the cart are bypassed for warmup.
  • It skips non-cacheable responses. Pages that send Set-Cookie headers, use Cache-Control: private or no-store, return non-200 statuses, or represent dynamic contexts (Cart, Checkout, My Account) are deliberately not cached.

For efficiency, warmup uses batch processing and concurrent HTTP requests. Concurrency defines how many URLs are fetched in parallel, while batch size determines how many URLs are handled in each cycle. Both settings can be tuned to match your server’s capacity.


Variants and Correctness

One of Mamba’s strengths is its careful handling of variants. Every warmed URL may expand into multiple versions based on:

  • Device: Separate caches for desktop and mobile (tablet optional via filter).
  • Language: Detected via Polylang or WPML, with a filter to override.
  • Currency: Detected via common multi-currency plugins, falling back to woocommerce_currency.
  • Country: Derived from WooCommerce geolocation, with an override header for testing.
  • Tax display: Separate caches for “incl. tax” vs. “excl. tax” modes.

Variant growth is capped by default to prevent over-expansion. Filters let you fine-tune which devices, countries, or other dimensions should be considered.


Admin and Automation

Mamba gives you control over warmup whether you’re managing a small shop or a CI/CD pipeline:

  • Admin UI: Warmup can be triggered from the plugin dashboard or the admin bar. Per-page options let you warm or purge + warm a specific URL.
  • REST API: For automated workflows, warmup can be started, monitored, cancelled, or resumed via REST endpoints. These include:
    • POST /mamba-wc/v1/warmup — start a job
    • GET /mamba-wc/v1/warmup-status — check progress
    • POST /mamba-wc/v1/warmup-cancel — cancel
    • POST /mamba-wc/v1/warmup-resume — resume
    • GET /mamba-wc/v1/warmup-errors — inspect failures
      Access is restricted to users with the appropriate WordPress capabilities (manage_options or manage_woocommerce).

Troubleshooting Warmup

  • A page didn’t get cached: It likely signaled “do not cache.” This is correct for dynamic contexts or private responses.
  • Cache stats didn’t change: Warmup requests are excluded from statistics, so this is expected.
  • Warmup feels slow: Start with fewer URLs or variants. Increase concurrency gradually, monitoring server load.

If your store uses a CDN, align your CDN’s TTLs with Mamba’s page cache TTL so warmed pages remain hot at the edge.


Copyright 2025 - Mamba


Mamba mascot