SpeedyGo adds a global Purge Cache option directly into the WordPress Admin Bar. This allows instant cache clearing without navigating to the settings page.
27.1 Overview #
With a single click from the top admin bar, administrators can immediately clear all cached files.
- No need to open plugin settings
- Instant cache invalidation
- Available across frontend and backend (for logged-in admins)
Technical Context #
- Hooks into
admin_bar_menu - Adds a custom top-level node: Purge Cache
- Clicking triggers a secure request
The purge process:
- Verifies nonce for security
- Calls:
speedygo_purge_all_cache() - Recursively deletes contents of:
wp-content/uploads/speedygo-cache/ - Regenerates cache on next page request (or via preloading)
27.2 Security Handling #
- Nonce verification prevents unauthorized requests
- Restricted to users with proper capabilities (e.g., administrators)
- Does not expose filesystem paths publicly
27.3 Best Practice Recommendation #
- Use after major content or design changes
- Clear cache after enabling/disabling optimization features
- Combine with Cache Preloading for seamless regeneration
The Admin Bar Purge Action provides fast, secure, and convenient cache management.