• Resolved atkulp

    (@atkulp)


    I have caching turned on including mobile and query strings. The cache count never seems to go over 2 or so. In the cache log I see lots of instances of “Page not cached because of active cron or ajax request.” The log does indicate pages being cached though so I suspect maybe it’s being cleared for some reason. Would it be possible to include the reason for cache in the log?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @atkulp

    I hope you are doing good today.

    Does “Clear full cache when post/page is updated” is enabled in Hummingbird? I ask because the “Clear full cache when post/page is updated” option can also clear all caches each time an update is happening.

    Could you also enable “Identify cached pages” and check the pages source in the browser does this code appears?

    <!– This page is cached by the Hummingbird Performance plugin v3.3.1 – https://wordpress.org/plugins/hummingbird-performance/. –>

    Kind Regards,
    Kris

    Thread Starter atkulp

    (@atkulp)

    No, “Clear full cache when post/page is updated” is not turned on

    I’ve included a link to see the current configuration. I haven’t made any update in the for at least 12 hours, and that was only saving a draft to an unpublished post.

    If I load pages, sometimes the header will be there, sometimes it won’t be. If I just refresh the main page, I can see it sometimes, refresh again and it’s gone.If I visit the Hummingbird Caching page, I can see the number go as high as three or four, but then drop down to one again.

    View post on imgur.com

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @atkulp

    Thank you for the screenshot,

    Could you please let us know if you have the Assets Optimization enabled?

    If so, could you try this script:

    <?php
    add_action( 'delete_transient_wphb-processing', function(){
    remove_all_actions( 'wphb_clear_page_cache', 10 );
    } );

    You can add it as a mu-plugin https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    I also suggest disabling the preload and letting your pages cache on the fly, the preload will only preload when the page cache is cleared for that specific page but in case it is not caching preload shouldn’t work.

    We are working on big improvements for Caching too: https://wpmudev.com/roadmap/#hummingbird

    Let us know the result you got.
    Best Regards
    Patrick Freitas

    Thread Starter atkulp

    (@atkulp)

    Yes, Assets Optimization is enabled. I had it in manual mode but I’m trying Automatic now to see if there’s a difference.

    Would that snippet (delete_transient_wphb-processing) run all the time then? I use Code Snippets so I can add it there instead, but I’m not clear what the lifecycle is on code in mu-plugins.

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @atkulp

    The snippet would “run all the time” but it’s not that it does some “resource heavy” actions. it simply “disables” automatic cache clearing on transient clean up. In other words, when there are some types of requests happening “live” on site (like on-going ajax or cron requests) they might be preventing optimization of some assets. This would mean Hummingbird would try to optimize them and transient might be deleted. It’s expected but then deleting transient also triggers cache clearing.

    The reason for this is to make sure that cache always keeps the most recent/up-to-date version of the page. The snippet simply stops that last step – clearing cache when transient is clear. Often it solves the issue so it’s worth a try.

    Best regards,
    Adam

    Thread Starter atkulp

    (@atkulp)

    ok. I’ve done this. the cache number goes up properly now. will this be fixed soon so I can remove the snippet?

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @atkulp

    Thanks for response!

    I’d rather suggest keeping the code on site. It’s not really a bug in the plugin but rather a side-effect of specifics of the site. Basically, any “on going” ajax or cron or similar requests would be breaking cache so if pages where these request are happening are not excluded from cache – the issue will be happening. If such requests are “all over the page” then it may result in site not being cached (almost) entirely. On the other hand, caching such requests/pages could result in some other issues – like some features of the site breaking or some data not being updated and so on.

    So that’s more of a “custom situation” and if the snippet fix it for you, please keep it there and it should be fine, though please also remember that whenever you make changes in Asset Optimization settings you may need to manually clear cache afterwards. That shouldn’t be frequently needed though.

    Best regards,
    Adam

    Thread Starter atkulp

    (@atkulp)

    Ok. thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Most pages don’t appear to be caching’ is closed to new replies.