[Hummingbird] bypass cache for single page

The cache is causing some problems on my site, I see that in settings it says "You can use the define('DONOTCACHEPAGE', true); constant to instruct Hummingbird not to cache specific pages or templates. " but it does not describe how or where to implement that. I need to bypass caching on a specific page – how do I do that?

  • Aditya Shah
    • DevOps Team Lead

    Hello Katie,

    Thank you for contacting WPMUDEV support. Hope you are doing great.

    I would like to update you that there is no need to use define('DONOTCACHEPAGE', true).

    define('DONOTCACHEPAGE', true) is used in templates or pages that are written in PHP.

    You can exclude any page directly from the admin section

    Please go to Dashboard > HummingBird > Caching > Page Caching > Exclusions > URL String and put /[your-url-of-the-page] there in each line. That should exclude the page from cache.

    Please let us know if that works for you. Have a nice day!

    Best,

    Aditya

  • Mike Langone
    • Flash Drive

    I would be interested as a theme/plugin developer on some more documentation on how and where to use that constant, can you use in an an array of page ids for example, or more specifically to do not cache a certain portion of a template. ie (do shortcode – gravity forms) etc?

    Also I noticed if using Hummingbird on a subsite of my network the option to specify pages/post to ignore is not available, so the only documentation states to use the constant.

    Thanks

  • Aditya Shah
    • DevOps Team Lead

    Hi Mike Langone

    The constant could be used anywhere in your page templates for which you want to force disable the page cache. I hope that would be simple as i couldn’t find any documentation for this but you can use that constant anywhere on the file maybe at the end of the code.

    define(‘DONOTCACHEPAGE’, true);

    It would not be possible to specifically exclude a portion of the page as Hummingbird cache complete page, what can help here is loading the form in an iframe maybe, just in case.

    Also, please use the constant carefully as it will stop all the pages generated by that template to be cached.

    I hope this clarifies.

    If you’re having any issues with it please start a new chat or ticket and we will be happy to help you further on this.

    Regards,

    Aditya Shah