# searchpro/4.0.21/inc/thirdparty/hosting/StackCDN.php

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

- Page: https://pluginprobe.com/plugins/searchpro/4.0.21/code/inc/thirdparty/hosting/StackCDN.php
- Raw: https://pluginprobe.com/plugins/searchpro/4.0.21/raw/inc/thirdparty/hosting/StackCDN.php
- Modified: 2026-05-20T17:15:50+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.21/code/inc/thirdparty/hosting/StackCDN.php#L10-L20`.

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

class berqStackCDN 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_page_cache']);
    }

    function is_stackcdn() {
        // WPStackCache class is instantiated by the 20i StackCache MU plugin (wp-stack-cache.php)
        return class_exists('WPStackCache');
    }

    function flush_cache() {
        if (!$this->is_stackcdn()) {
            return;
        }
        berqReverseProxyCache::flush_all();
    }

    function flush_page_cache($slug) {
        if (!$this->is_stackcdn()) {
            return;
        }
        if (empty($slug)) {
            $slug = '/';
        }
        berqReverseProxyCache::purge_cache(home_url($slug));
    }
}

new berqStackCDN();

```
