CR Bee Docs

Caching

Cache plugin compatibility and configuration

CR Bee Connect handles caching at two levels: API response caching (transients) and page cache compatibility (WP Rocket, LiteSpeed, etc.).

API Response Caching

The plugin caches API responses as WordPress transients to reduce API calls:

DataCache KeyTTL
Settingscrbc_settings_{locale}5 minutes
Carscrbc_cars5 minutes
Single Carcrbc_car_{slug}5 minutes
Featured Carscrbc_cars_featured5 minutes
Locationscrbc_locations15 minutes
Categoriescrbc_categories15 minutes
Addonscrbc_addons, crbc_addons_{carId}15 minutes
Featurescrbc_features15 minutes

Transactional data (sessions, bookings, quotes) is never cached.

Automatic Cache Invalidation

When you make changes in the CR Bee admin dashboard (e.g., add a vehicle, update prices), a catalog.updated webhook is sent to the plugin, which:

  1. Flushes the relevant transient cache (e.g., crbc_cars*)
  2. Triggers a full page cache purge via the crbc_cache_flushed action

This ensures your WordPress site always shows up-to-date data.

Page Cache Compatibility

Booking flow pages must not be cached by your page cache plugin, as they depend on session state. The plugin handles this automatically:

Automatic Exclusion

On booking flow pages (search, results, vehicle details, addons, checkout, confirmation, manage), the plugin:

  • Sets the DONOTCACHEPAGE constant
  • Sends nocache_headers() (Cache-Control, Pragma, Expires)

Supported Cache Plugins

PluginIntegration
WP RocketExcludes CR Bee scripts from Delay JS; bypasses cache when crbc_session cookie exists; skips booking flow pages from preload; full cache purge on webhook
LiteSpeed CacheFull purge on webhook via litespeed_purge_all
WP Super CacheFull purge on webhook via wp_cache_clear_cache()
W3 Total CacheFull purge on webhook via w3tc_flush_all()

WP Rocket Specifics

The plugin automatically configures these WP Rocket filters:

  • Delay JS Exclusion — CR Bee scripts (cr-bee-connect, crbc, flatpickr, splide) are excluded from JavaScript delay
  • Cookie Bypass — Cache is bypassed when the crbc_session cookie exists
  • Preload Exclusion — Booking flow pages are excluded from preload crawling

No manual WP Rocket configuration is needed.

Manual Cache Flush

Go to CR Bee Connect > Cache tab and click Flush Cache to manually clear all cached API data.

DNS Optimization

The plugin automatically adds DNS prefetch and preconnect resource hints for the CR Bee API domain, improving connection speed for API calls.

Troubleshooting

  • Stale data after changes — Click Flush Cache, or verify the webhook is registered
  • Booking flow not working — Check that your cache plugin isn't caching booking pages
  • WP Rocket conflicts — The plugin handles all WP Rocket configuration automatically; if issues persist, manually exclude booking page URLs from caching

On this page