• Resolved rsmith4321

    (@rsmith4321)


    I’ve noticed if using Cloudflare APO full page caching, the forms will stop appearing after a couple of days. I’m not sure of the exact time I just noticed it a few days later and had to clear the Cloudflare cache. I believe APO caches pages for about 30 days with no option to change this. I’ve set for the form to use Ajax loading as well as not to cache pages with forms. However APO seems to ignore the second option headers and caches the page anyway. I wonder if you could test Ajax form loading with Cloudflare APO and find a way for it to work even on a cached page. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @rsmith4321

    I hope you are doing good today.

    I pinged our SLS and QA Team to review your query. Thank you for your patience while we look into this further.

    Kind Regards,
    Kris

    Hi again @rsmith4321

    Could you try this code as a mu-plugin:

    <?php
    function wpmudev_forminator_ajax_load_without_nonce() {
    	$_POST[ 'nonce' ] = wp_create_nonce( 'forminator_load_module' );
    }
    
    add_action( 'wp_ajax_forminator_load_form', 'wpmudev_forminator_ajax_load_without_nonce' );
    add_action( 'wp_ajax_nopriv_forminator_load_form', 'wpmudev_forminator_ajax_load_without_nonce' );

    This snippet sort of cancels nonce check when loading a form with ajax.

    You can install this code as a mu-plugin following this guide:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Kind Regards,
    Kris

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @rsmith4321 ,

    We haven’t heard from you for a while now, so it looks like the shared code worked for you.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

    Thread Starter rsmith4321

    (@rsmith4321)

    Thanks for the help! Actually, I’m just getting around to trying the code now, it will take a couple of days to see how it works. Shouldn’t this be the default behavior if someone is activating ajax for the specific reason of fixing cache issues as the selection states? Most page caches keep the cache for more than a day or so, I realized even my local litespeed cache will break the form loading if the page is cached for more than a couple of days.

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

The topic ‘Issues with Cloudflare APO’ is closed to new replies.