ChatCart ProChatCart Pro
Caching

Caching

How to configure browser and CDN caching so your customers always see the latest version of ChatCart Pro's scripts and styles.

Using the Free Version (WordPress.org)?

Replace every occurrence of chatcart-pro with veloryn-chat-checkout in all cache rules, paths, and expressions below. All other steps are identical.

Why Caching Matters

CDN and browser caches can store old versions of your plugin's CSS and JavaScript files, causing the plugin to behave as if it hadn't been updated, even after you've installed a new version. This can break the checkout form, display outdated button styles, or prevent recent bug fixes from taking effect.

ChatCart Pro already appends a version query string (e.g. ?ver=2.0.3) to all enqueued assets, which WordPress busts automatically on update. However, if you're using Cloudflare's cache or an aggressive WordPress caching plugin, those version strings may be stripped or ignored.

Option A: Cloudflare Cache Rule

If you use Cloudflare in front of your WordPress site, the recommended approach is to add a Cache Rule that tells Cloudflare never to cache your plugin's assets.

Step 1: Open Cache Rules

In the Cloudflare dashboard, select your domain, then go to Caching → Cache Rules. Click Create rule.

Step 2: Name the Rule

Give the rule a descriptive name, for example: ChatCart Pro: bypass plugin cache.

Step 3: Set the Expression

Under "When incoming requests match...", switch to the Expression Builder and paste the following expression:

Cloudflare Cache Rule expression
(starts_with(http.request.uri.path, 300">"/wp-content/plugins/chatcart-pro/"))

Step 4: Set Cache Status to Bypass

Under "Then...", set Cache status to Bypass. Click Deploy.

Using the Visual Builder Instead

If you prefer the point-and-click builder over the expression editor:

  • Field: URI Path
  • Operator: starts with
  • Value: /wp-content/plugins/chatcart-pro/

What this does

Any request whose path starts with /wp-content/plugins/chatcart-pro/ will bypass Cloudflare's cache entirely. Your plugin's CSS and JavaScript files will always be served fresh from your origin server.

Optional: Also Exclude the WordPress Admin

If you ever see stale admin pages, add a second rule matching /wp-admin/ with the same Bypass cache status.

Option B: Version String Cache Busting (Built In)

ChatCart Pro uses WordPress's wp_enqueue_scripts with a version parameter on every asset. Every CSS and JavaScript file is loaded with a query string like ?ver=2.0.3.

WordPress version query string (automatic)
<link rel=300">"stylesheet" href=300">"/wp-content/plugins/chatcart-pro/assets/css/frontend.css?ver=2.0.3" />
<script src=300">"/wp-content/plugins/chatcart-pro/assets/js/checkout.js?ver=2.0.3"></script>

When you update the plugin, the version number changes and the query string changes with it. This forces browsers and most caches to treat the file as new and re-download it.

Developer tip

If you're actively developing a child theme or custom plugin that depends on ChatCart Pro's styles, add define('WP_DEBUG', true); to wp-config.php. WordPress will skip its own script caching layer, so you always load the freshest assets.

WordPress Caching Plugins

If you use a WordPress caching plugin, no special configuration is needed for ChatCart Pro; version strings handle cache busting automatically. That said, here is what to expect from the most common plugins:

W3 Total Cache

Compatible. Flush the cache after every ChatCart Pro update. In W3 Total Cache, go to Performance → Dashboard and click Empty All Caches.

WP Super Cache

Compatible. Delete the cache from Settings → WP Super Cache → Delete Cache after updating.

WP Rocket

Compatible. No special configuration needed. WP Rocket respects WordPress version strings. Clear the cache after a plugin update via the WP Rocket toolbar menu.

LiteSpeed Cache

Compatible. LiteSpeed correctly handles AJAX-driven content and respects version query strings. If something looks outdated after an update, go to LiteSpeed Cache → Toolbox → Purge All.

Checkout page caching

Never cache the WooCommerce checkout page. All major caching plugins automatically exclude it, but if you use a custom caching setup, make sure your checkout URL is in the exclusion list. Caching the checkout page will break the ChatCart Pro form.