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:
| Data | Cache Key | TTL |
|---|---|---|
| Settings | crbc_settings_{locale} | 5 minutes |
| Cars | crbc_cars | 5 minutes |
| Single Car | crbc_car_{slug} | 5 minutes |
| Featured Cars | crbc_cars_featured | 5 minutes |
| Locations | crbc_locations | 15 minutes |
| Categories | crbc_categories | 15 minutes |
| Addons | crbc_addons, crbc_addons_{carId} | 15 minutes |
| Features | crbc_features | 15 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:
- Flushes the relevant transient cache (e.g.,
crbc_cars*) - Triggers a full page cache purge via the
crbc_cache_flushedaction
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
DONOTCACHEPAGEconstant - Sends
nocache_headers()(Cache-Control, Pragma, Expires)
Supported Cache Plugins
| Plugin | Integration |
|---|---|
| WP Rocket | Excludes 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 Cache | Full purge on webhook via litespeed_purge_all |
| WP Super Cache | Full purge on webhook via wp_cache_clear_cache() |
| W3 Total Cache | Full 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_sessioncookie 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