Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter carlosbarbosa

    (@carlosbarbosa)

    Hacked my way around it for now:

    <?php
    /**
    * Plugin Name
    *
    * @package Nginx Helper Cloudflare Sync
    * @author Carlos Barbosa
    * @copyright 2020 CBD
    * @license GPL-2.0-or-later
    *
    * @wordpress-plugin
    * Plugin Name: Nginx Helper Cloudflare Sync
    * Description: Clears Cloudflare cache when nginx-helper does its thing.
    * Version: 1.0.1
    * Author: Carlos Barbosa
    * Author URI: carlosbarbosamexico@gmail.com
    * License: GPLv2 or later
    * Text Domain: nginx-helper-cf
    */

    add_action(‘rt_nginx_helper_after_fastcgi_purge_all’, ‘nginx_helper_cf_purge_all_action’);
    function nginx_helper_cf_purge_all_action ()
    {
    $cloudflareHooks = new \CF\WordPress\Hooks();
    $cloudflareHooks->purgeCacheEverything();
    }

    add_filter(‘rt_nginx_helper_purge_url’, ‘nginx_helper_cf_purge_url_filter’);
    function nginx_helper_cf_purge_url_filter($url)
    {
    $pid = url_to_postid($url);

    if ($pid > 0)
    {
    $cloudflareHooks = new \CF\WordPress\Hooks();
    $cloudflareHooks->purgeCacheByRelevantURLs($pid);
    }

    return $url;
    }

    Unfortunately this issue is still present, our site is a news aggregator with over 300 000 posts, after moving from Yoast to TSF our monitoring systems quickly spotted timeouts when reaching sitemap.xml (600 seconds), we’ve tried everything in this thread and beyond to make it work, it always timed out or exhausted memory (512M), we installed Google XML Sitemap Generator and the issue was gone instantly, it creates our sitemap in around 15 seconds (including inner sitemap pages). Please keep working on the sitemap thingy. Pagination is a must definitely.

    • This reply was modified 5 years, 9 months ago by carlosbarbosa.
Viewing 2 replies - 1 through 2 (of 2 total)