Jul 29, 2025

YITH Quote Counter Stuck? How We Solved a WP Engine Caching Nightmare

Explore more from: Case Study, Wordpress

One of our clients at SEODogs runs a large-scale WooCommerce store (Process Industrial Supply) with over 75,000 products, using YITH’s “Request a Quote” feature to manage custom orders. However, they encountered a critical issue: the quote counter wasn’t updating for guest users, whether using Ajax or Redirect method, on their WP Engine-hosted site. While logged-in users saw accurate data, guests were stuck with stale, cached counts — a direct result of WP Engine’s aggressive caching system.

And we quickly discovered the culprit: WP Engine’s aggressive caching.


The Caching Challenge

WP Engine is built for speed. Its caching system aggressively stores pages to ensure blazing-fast load times. However, this optimization can sometimes backfire for dynamic site features.

By default, WP Engine excludes only a handful of WooCommerce URLs from caching:

^/cart  
^/checkout
^/my-account
^/wc-api
^/addons
^/(.*)\?wc-ajax=.*

These rules work perfectly for WooCommerce’s default AJAX cart and checkout operations. But YITH’s quote system? It doesn’t play by the same rules.


The YITH Approach — And Its Problem

Unlike WooCommerce, YITH uses custom AJAX endpoints like yith_ywraq_add_to_quote and its own session handling via cookies.

The result? WP Engine doesn’t recognize YITH’s endpoints as dynamic, which means cached pages are served to guest users with stale quote data.

This left the quote counter and list out of sync, creating confusion for customers.


Who’s to Blame?

While WP Engine’s caching is strict, YITH could have done better. If the plugin leveraged WooCommerce’s default hooks and AJAX structures, these problems wouldn’t exist. Hosting providers, including WP Engine, are already optimized to handle WooCommerce’s standard endpoints.

For example, when we developed Taskmaster’s quote functionality, we built it using WooCommerce’s AJAX framework — ensuring smooth compatibility with caching.


Our Solution: Real-Time Quote Counter

We needed a fix that was fast, accurate, and didn’t involve rebuilding YITH’s core.

The fix?
We implemented a real-time quote counter that fetches the quote count using admin-ajax.php. This ensures every visitor — guest or logged-in — sees the correct count, regardless of cached pages.

While this approach introduces a tiny delay (<4 seconds) for the counter to update, it’s a fair trade-off for accuracy.


Custom Cache Exclusions

In this specific case, the Request a Quote page used the /request-quote slug. To prevent caching conflicts, we added these rules to the cache exclusions:

^/request-quote  
^/wp-admin/admin-ajax.php/?$

This ensures that dynamic AJAX requests bypass caching, keeping quote data fresh even for guest users.


The Outcome

After implementing this solution:

  • The quote counter updates accurately on all pages.
  • No core plugin modifications were needed.
  • The site remains fast and cache-optimized, with no negative impact on performance.

Final Thoughts

This experience highlights the gap between plugin developers and hosting environments. YITH’s custom structure isn’t cache-friendly, but with the right tweaks — like real-time AJAX fetches and cache exclusions — the functionality is stable and production-ready.

For a long-term, foolproof solution, YITH would need to adopt WooCommerce’s default AJAX mechanisms. Until then, our approach strikes the perfect balance between performance and reliability.

Interested in a similar or bespoke solution? Let us know what you need, and we’ll deliver a tailored proposal focused on driving measurable success for your business.