• Resolved Marcelo Pedra

    (@kent-brockman)


    Hello! I’m using your plugin in several sites and it’s pretty great.

    I noticed you have added some actions to clear the cache when plugins like NGG, CF7 or even WooThemes themes save settings. But there is another one you can add in order to improve compatibility. The plugin “WordPress SuperSonic with CloudFlare” has a great Cloudflare integration but it’s oriented to clear the cloud cache when posts/pages/comments are saved. But it won’t clear the cache when other actions produce changes in the frontend (menus, themes, widgets, etc).

    So, I found that adding these actions to ccfm_admin_init() in clear-cache-for-widgets.php will do the trick:

    add_action( 'wp_ajax_save-widget', 'wpss_save_post');
    add_action( 'wp_ajax_widgets-order', 'wpss_save_post');
    add_action( 'sidebar_admin_setup', 'wpss_save_post');
    add_action( 'customize_save_after', 'wpss_save_post');
    add_action( 'wp_update_nav_menu', 'wpss_save_post');
    add_action( 'switch_theme', 'wpss_save_post');

    The issue with Supersonic is that it recommends using Page Rules at Cloudflare: https://ww.wp.xz.cn/plugins/supersonic/faq/ This make the cached pages persistent for longer times, making your site run ultra fast, but when you need a rapid/massive widgets/menu update, you will need your website cache to be rapidly updated. And the above code make it possible.

    Hope you can take it into consideration soon.
    Very thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Marcelo Pedra

    (@kent-brockman)

    Indeed, I also use for some sites the official Cloudflare plugin, which also has its own actions to trigger Cloudflare cache clearing. I didn’t analyzed their code very in deep, but AFAIS it looks a bit more robust and complete than others.

    Plugin Author webheadcoder

    (@webheadllc)

    Hi,

    I’m glad you find my plugin useful!

    The Supersonic Cloudflare plugin doesn’t seem to have very many active installs so I don’t think I’ll be adding support for that. However, you can use the hooks throughout the plugin to get it working for your install.

    Add a filter for ‘ccfm_supported_caching_exists’. This is a check to make sure the Supersonic plugin is active. Something checking if a function exists should work fine.

    Then you can add an action for ‘ccfm_clear_cache_for_me’ action to call whatever function the Supersonic Cloudflare plugin uses to clear the cache.

    Once you setup these two hooks the Supersonic plugin will be a supported caching system on your install and will clear the cache the same as if it were built into the plugin.

    Thread Starter Marcelo Pedra

    (@kent-brockman)

    ok great. Thanks for the suggestions.

    It’s a pity the Supersonic plugin is not that widely adopted since it does a great job accelerating websites with Cloudflare.

    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Feature Request: add compatibility with Supersonic plugin for Cloudflare’ is closed to new replies.