• Resolved leoluc

    (@leoluc)


    Hi everyone. I love your plugin, but it is giving me problems with ajax requests. On my website, I noticed that sometimes ajax requests do not work and show error 403(forbidden). When it does that, I can always solve it by manually clearing the Hummingbird cache. Since I am using WordPress nonces, I guessed that this error is due to the expiration of the nonce contained in the cached page, and I set che Clear cache on interval option to 10 hours, while a new nonce should be created every 12 hours and should last for 24 hours by WordPress default. After I did that, ajax requests stopped working again approximately one day later and I solved it again by simply clearing the cache, suggesting that the automated cache clearing did not work.
    How can I check if the automated cache clearing is working ?
    Do you have any ideas that could help me on this ?
    Thank you in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @leoluc

    I hope you’re well today and thank you for your question!

    You can verify if the cache was automatically cleared (e.g. on interval) for example by checking content of the

    /wp-content/wphb-cache/cache/YOUR_DOMAIN_HERE/

    folder. You’ll see a bunch of files there – it’s a cached content. If you check that from time to time, you’ll see if files were removed from there or got updated dates.

    You can also enable “Enable debug log” option in “Page Cache” settings in Hummingbird and check back on that page after some time (after cache would be expected to get cleared). You’ll see a link there to download logs and in the log you should see information about pages being cached or cache purged.

    So that should help you verify whether automatic cache clearing works fine or not.

    But I’m also wondering about something else. I think that 10 hours cache clearing interval with 12 hours nonce regeneration interval – that will always go “out of sync” sooner or later. Additionally, nonces are, by default, “one time” so only last for session and if session is ended/expires they shoudl become invalid anyway. That is, unless you are using some specific custom implementation of that.

    So my question is, how are you using this? Is this some additional plugin or some custom code/implementation and if so, could you describe it a bit more?

    Or are you just referring to the standard, default WordPress nonce mechanism?

    Best regards,
    Adam

    Thread Starter leoluc

    (@leoluc)

    Hi Adam,

    thank you for your reply. I checked the folder you mentioned, and the cache files are 24 hours old, corresponding to the last time I cleared the cache manually. I think it means that the automatic cache clearing is not working for some reason. I enabled the debug log and let’s see what happens.
    I am using the standard, default WordPress nonce mechanism, an I understood that nonces regenerate every 12 hours, but every generated nonce is valid for 24 hours, meaning that there are two valid nonces at every moment. This way if I set a cache expiration interval lower than 12 hours, the nonces should never expire because the cache would contain at least the older one.
    I will write here as soon as I get results from the debug log.
    Thank you again,

    Leo

    Thread Starter leoluc

    (@leoluc)

    Hi Adam,

    the automatic cache clearing still does not work. The log shows two main problems:

    [2021-05-18T15:44:00+00:00] Caching to file: /******/*******/public_html/wp-content/wphb-cache/cache/*********/705c42fbf503ad753053a6032ca5e02b.html
    [2021-05-18T15:44:00+00:00] Cached file found. Serving to user.
    [2021-05-18T15:44:01+00:00] Loading config file.
    [2021-05-18T15:44:01+00:00] Skipping page. Used POST method. Only GET allowed.
    [2021-05-18T15:44:02+00:00] Loading config file.
    [2021-05-18T15:44:02+00:00] Page not cached because of active cron or ajax request.

    and

    [2021-05-18T15:40:33+00:00] Caching to file: /******/*******/public_html/wp-content/wphb-cache/cache/********/28cf38c3b76063090a34b2c60e7f8d8b.html
    [2021-05-18T15:40:33+00:00] Cached file not found. Passing to ob_start.
    [2021-05-18T15:40:34+00:00] Loading config file.
    [2021-05-18T15:40:34+00:00] Page not cached because of active cron or ajax request.
    [2021-05-18T15:40:34+00:00] Empty buffer. Exiting.
    [2021-05-18T15:40:34+00:00] Page not cached because unsupported http response code: 301
    [2021-05-18T15:40:34+00:00] HTML corrupt. Page not cached.
    [2021-05-18T15:40:34+00:00] Page not cached. Sending buffer to user.

    I do not know what these errors mean… Can you help me in solving them ?

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @leoluc

    Could you please create a full backup or a staging website https://wordpress.org/plugins/wp-staging/ and switch to a different theme to verify if it makes any difference?

    Usually the [2021-05-18T15:40:34+00:00] HTML corrupt. Page not cached. is related to theme structure issue for example a missing close body or HTML in the footer.

    So it may be related to other issues too.

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

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @leoluc

    I hope you are doing well and safe!

    We haven’t heard from you in a while, I’ll mark this thread as resolved.

    Feel free to let us know if you have any additional question or problem.

    Best Regards
    Patrick Freitas

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Clear cache on interval not working’ is closed to new replies.