Caching & Performance
Dino Discounts is built with aggressive caching internally, but it also needs your full-page caching plugin configured correctly.
Internal caching
Section titled “Internal caching”The plugin handles its own performance optimisation:
Cart fingerprinting
Section titled “Cart fingerprinting”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 caching
Section titled “Discount caching”Discount definitions are loaded from the database once and cached in WordPress transients. Discount changes invalidate the cache automatically when you publish.
Zone caching
Section titled “Zone caching”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.
Full-page caching compatibility
Section titled “Full-page caching compatibility”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/
Why this matters
Section titled “Why this matters”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)
Object caching
Section titled “Object caching”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.
CDN compatibility
Section titled “CDN compatibility”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.