Cache-Busting System
Overview
The WPiko Chatbot Cache-Busting System ensures that your chatbot interface always displays the latest settings and content by automatically clearing caches whenever relevant options are updated. This system is designed to work seamlessly with popular WordPress caching plugins, preventing outdated chatbot data from being served to users.
How Cache-Busting Works
Whenever you update chatbot settings—such as appearance, features, or Pro options—the cache-busting system:
- Detects changes to monitored options.
- Clears caches for WordPress and supported caching plugins.
- Updates asset versions to force browsers to load fresh scripts and styles.
- Adds cache version headers to chatbot content for reliable cache invalidation.
This process is fully automated, requiring no manual intervention for most users.
Supported Caching Plugins
WPiko Chatbot’s cache-busting system integrates with many popular caching plugins, including:
- WP Rocket
- W3 Total Cache
- WP Super Cache
- LiteSpeed Cache
- WP Fastest Cache
- Autoptimize
- WP Optimize
- Breeze
- SG Optimizer
- Comet Cache
- Cache Enabler
- Swift Performance
- Hummingbird
If no supported caching plugin is detected, the system will prompt you to clear your cache manually.
Monitored Options
Cache is automatically cleared when you update any of the following:
- Chatbot appearance: Name, image, colors, welcome message, etc.
- Chatbot features: Sound, transcript download, floating chatbot, menu options.
- Exclusions: Pages or posts where chatbot should not appear.
- Questions: Predefined chatbot questions.
- Pro features: Email capture, contact form, reCAPTCHA, WooCommerce integration, license activation, and more.
Pro plugin options are automatically added to the monitored list when WPiko Chatbot Pro is active.
Real-World Example
Suppose you change the chatbot’s primary color or enable the email capture feature in the Pro plugin. The cache-busting system will:
- Update the cache version key.
- Clear caches for all detected caching plugins.
- Purge WordPress transients related to the chatbot.
- Add a new cache version to assets and headers.
- Display an admin notice confirming cache clearance.
Your users will immediately see the updated chatbot interface without needing to refresh or clear their browser cache.
Best Practices
- Always use the plugin’s settings pages to make changes. Manual database edits may not trigger cache-busting.
- Check admin notices after saving settings to confirm cache was cleared.
- If you use a caching plugin not listed above, clear its cache manually after making changes.
- Keep both plugins updated to benefit from the latest cache-busting improvements.
Advanced Features
- Dynamic Asset Versioning: Scripts and styles are served with a unique cache version, ensuring browsers always fetch the latest files.
- Cache Headers: Meta tags and JavaScript variables are injected into pages with chatbot content, helping frontend code and AJAX requests use the correct cache version.
- Pro Plugin Integration: WPiko Chatbot Pro extends cache-busting to cover advanced features and hooks into license activation, contact form, and email capture updates.
Troubleshooting
- Changes not appearing? Check for admin notices about cache clearing. If none appear, manually clear your site’s cache.
- Custom caching solutions: If you use a custom or less common caching plugin, add a hook to the
wpiko_chatbot_cache_monitored_optionsfilter to ensure your options are monitored. - Stale assets: If you see outdated scripts or styles, try clearing your browser cache or use the plugin’s “Clear Cache” button (if available).
Updating Cache-Busting Settings
- Navigate to the WPiko Chatbot settings in your WordPress admin panel.
- Change any monitored option (see above for list).
- Save your changes.
- Look for a success notice confirming cache clearance.
- Verify that your chatbot interface reflects the latest updates.
Use Cases
- Branding updates: Instantly reflect new colors, logos, or welcome messages.
- Feature toggles: Enable/disable Pro features and see changes immediately.
- Content updates: Add or modify chatbot questions and ensure users see the latest options.
- Performance: Prevent users from seeing outdated or cached chatbot responses.
Tips for Effective Cache Management
- Regularly review admin notices for cache-related messages.
- Test changes on both desktop and mobile devices.
- Monitor cache plugin updates for compatibility.
- Contact support if you experience persistent caching issues.
Summary
The WPiko Chatbot cache-busting system provides a robust, automated solution for keeping your chatbot interface up-to-date. By integrating with major caching plugins and monitoring all relevant options, it ensures a smooth and consistent user experience for both free and Pro users.