How to enable specific cache settings?

I am tryig to perform a function that is triggered when the filter cloudflare_purge_by_url is performed.

I tried debuggin the filter and realized that in Hooks.php theres a condition for this where is checks for the following:

public function purgeCacheEverything()
    {
        if ($this->isPluginSpecificCacheEnabled() || $this->isAutomaticPlatformOptimizationEnabled()) {
            $wpDomainList = $this->integrationAPI->getDomainList();
            if (count($wpDomainList) > 0) {
                $wpDomain = $wpDomainList[0];

                $zoneTag = $this->api->getZoneTag($wpDomain);

                if (isset($zoneTag)) {
                    $isOK = $this->api->zonePurgeCache($zoneTag);

                    $isOK = ($isOK) ? 'succeeded' : 'failed';
                    $this->logger->debug("purgeCacheEverything " . $isOK);
                }
            }
        }
    }

For some reasons my debugger never enters inside the “if” statement. Is there any way to check that this settings are enabled?

If you’re asking if there’s a way to determine if APO is enabled, here’s the API call:

https://developers.cloudflare.com/api/operations/zone-settings-get-automatic_platform_optimization-setting

What about checking if specific cache settings are enabled, cause i didn´t find any endpoint to verify that.

Which specific cache settings?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.