Skip to content

Caching & Performance

Dino Discounts is built with aggressive caching internally, but it also needs your full-page caching plugin configured correctly.

The plugin handles its own performance optimisation:

Every time the cart is evaluated, the engine creates a fingerprint (hash) of the cart contents, quantities, customer data, and applied coupons. If the fingerprint hasn’t changed, the previous result is reused — no recalculation.

Discount definitions are loaded from the database once and cached in WordPress transients. Discount changes invalidate the cache automatically when you publish.

Zone definitions (country → zone mappings) are cached similarly. Changes to zones invalidate the cache on publish.

You don’t need to configure any of this — it works automatically.

If you use a full-page caching plugin, you must exclude cart and checkout pages from the cache. This applies to:

  • WP Rocket — Add /cart/ and /checkout/ to “Never Cache” URLs
  • WP Super Cache — Add these paths to “Rejected URI Strings”
  • W3 Total Cache — Add to “Never Cache” pages
  • LiteSpeed Cache — Add to “Do Not Cache URIs”
  • SiteGround Optimizer — Add to cache exclusion list
  • Any other full-page cache — Exclude /cart/ and /checkout/

Full-page caching serves a saved copy of the page to every visitor. If the cart page is cached, every customer sees the same cart — discounts calculated for one customer are shown to all others. This causes:

  • Discounts appearing to not apply
  • Wrong discount amounts
  • Other customers’ cart contents being visible (in extreme cases)

Dino Discounts works fine with object caching (Redis, Memcached). WordPress transients are stored in the object cache when available, which makes discount and zone loading faster.

No special configuration is needed.

CDNs (Cloudflare, Fastly, etc.) that cache HTML pages need the same cart/checkout exclusion as full-page caching plugins. Most CDN setups already exclude these pages, but verify yours does.

API calls (/wp-json/dino-discounts/v1/*) should never be cached by your CDN. Most CDN configurations exclude /wp-json/ by default.