# FastPixel — MainWP Cache Control Integration ## What This Does Integrates FastPixel (page cache + object cache + CF purge) with MainWP's Cache Control extension so that: - Cache Control shows **FastPixel** as the cache solution for all sites - The **Clear Cache** button in MainWP purges FastPixel page cache AND Divi static CSS on the child site - Auto-purge fires on plugin/theme updates via MainWP - Bulk purge works from Cache Control → Sites --- ## Why It's Non-Standard FastPixel is not in MainWP's official supported cache plugin list. MainWP developer docs at https://mainwp.dev/cache-control-custom-addition/ describe adding support via a PR to mainwp-child. **As of July 2026, no upstream PR exists.** FastPixel developer (Claude) was asked to submit one June 2026 — it never happened. This patch is now the permanent solution, not a temporary workaround. --- ## Components ### 1. mainwp-child patch (on every child site) **File:** `/home//public_html/wp-content/plugins/mainwp-child/class/class-mainwp-child-cache-purge.php` Three changes made to this file: **a) $other_cache_plugins array** — FastPixel added after AccelerateWP: ```php 'fastpixel-website-accelerator/fastpixel.php' => 'FastPixel', ``` **b) auto_purge_cache() switch** — FastPixel case added after AccelerateWP: ```php case 'FastPixel': $information = $this->fastpixel_auto_purge_cache(); break; ``` **c) fastpixel_auto_purge_cache() method** — added before class closing brace: ```php public function fastpixel_auto_purge_cache() { $success_message = 'FastPixel => Cache auto cleared on: (' . current_time( 'mysql' ) . ')'; $error_message = 'FastPixel => There was an issue purging your cache.'; $purged = false; if ( class_exists( '\FASTPIXEL\FASTPIXEL_Backend_Cache' ) ) { $cache = \FASTPIXEL\FASTPIXEL_Backend_Cache::get_instance(); if ( method_exists( $cache, 'purge_all' ) ) { $purged = $cache->purge_all(); } } if ( ! $purged ) { $cache_dir = WP_CONTENT_DIR . '/cache/fastpixel-website-accelerator'; if ( is_dir( $cache_dir ) ) { file_put_contents( $cache_dir . '/invalidated', json_encode( array( 'time' => gmdate( 'Y-m-d H:i:s' ) ) ) ); $purged = true; } } if ( class_exists( '\ET_Core_PageResource' ) ) { \ET_Core_PageResource::remove_static_resources( 'all', 'all' ); } if ( $purged ) { update_option( 'mainwp_cache_control_last_purged', time() ); return $this->purge_result( $success_message, 'SUCCESS' ); } else { return $this->purge_result( $error_message, 'ERROR' ); } } ``` ⚠️ **Critical namespace note:** The file is in the `MainWP\Child` namespace. All external class references MUST have a leading backslash (`\FASTPIXEL\...`, `\ET_Core_PageResource`) or PHP resolves them as `MainWP\Child\FASTPIXEL\...` and fatals. This was the bug in the first rollout attempt. --- ### 2. kaburu-fp-purge-endpoint plugin (on every child site) **File:** `/home//public_html/wp-content/plugins/kaburu-fp-purge-endpoint/kaburu-fp-purge-endpoint.php` **Purpose:** Shim plugin. MainWP child's `check_cache_solution()` runs at `plugins_loaded` priority 99 and overwrites `mainwp_cache_control_cache_solution` — since FP isn't in its list, it sets "Plugin Not Found". This plugin hooks at priority 100 and corrects it back to "FastPixel". **v3.2.0 (2026-07-07):** Simplified — removed `is_plugin_active()` check (doesn't work on frontend). If this plugin is active, FastPixel is present. ```php