# searchpro/4.0.26/inc/thirdparty/hosting/WPEngine.php

BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS &amp; JavaScript, version 4.0.26. 44 lines.

- Page: https://pluginprobe.com/plugins/searchpro/4.0.26/code/inc/thirdparty/hosting/WPEngine.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.0.26/raw/inc/thirdparty/hosting/WPEngine.php
- Modified: 2026-05-29T16:46:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/searchpro/4.0.26/code/inc/thirdparty/hosting/WPEngine.php#L10-L20`.

```php
<?php
if (!defined('ABSPATH')) exit;

class WPEngine extends berqIntegrations {
    function __construct() {
        add_action('berqwp_flush_all_cache', [$this, 'flush_cache']);
        add_action('berqwp_stored_page_cache', [$this, 'flush_page_cache']);
        add_action('berqwp_flush_page_cache', [$this, 'flush_cache']);
    }


    function flush_cache() {

        if (class_exists('WpeCommon')) {
            if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) {
                WpeCommon::purge_memcached();
            }

            if ( method_exists( 'WpeCommon', 'purge_varnish_cache' ) ) {
                WpeCommon::purge_varnish_cache();
            }
        }
    }

    function flush_page_cache($slug) {

        if (empty($slug)) {
            $slug = '/';
        }

        if (class_exists('WpeCommon')) {
            if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) {
                WpeCommon::purge_memcached();
            }

            // WpeCommon::purge_varnish_cache() does not support per-URL purge; using reverse proxy purge instead
            // WpeCommon::purge_varnish_cache();
            berqReverseProxyCache::purge_cache(home_url($slug));
        }
    }

}

new WPEngine();
```
