• Hi folks,

    WPStatistics has a mode whereby it can use the WP-JSON API, which WP Cloudflare Super Page Cache kindly by default doesn’t cache.

    WPStatistics doesn’t use this route by default (dunno why? to minimise requests?) but it can be turned on easily: https://ibb.co/Pr8Ytnk

    However, each hit on the JSON API has a nonce, but apparently they expire after 12 hours. https://ibb.co/Tk0BVwk
    https://wp-statistics.com/resources/troubleshoot-with-cache-plugins/

    It seems therefore that “Cloudflare Cache-Control max-age” should be set at no more than “43200” (seconds) (i.e. 12 hours) for the WPStatistics API to behave as expected.

    I’ve set mine at 43199 seconds. https://ibb.co/k9sZt3g

    Without this, invalid nonce errors occur on HIT: https://ibb.co/PmC0J9p

    Is this configuration sensible? And is there any way that this could be solved on the side of either plugin?

    Thanks,

    Harry.

    • This topic was modified 3 years, 4 months ago by harryfear. Reason: Clarity
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    First of all if you would like to bypass cache for WP JSON request you can easily enable that inside the plugin settings > cache tab: https://i.imgur.com/bRFSWrF.png

    This should resolve your issues. But if you would like to overwrite the default s-maxage value of the plugin, you can do that again from the plugin settings > cache tab: https://i.imgur.com/xBWobKx.png

    But again I don’t think the s-maxage needs to be changed if you bypass the WP JSON as stated above. So, try and see what happens.

    Thread Starter harryfear

    (@harryfear)

    Thanks, will experiment with this and revert in 48hrs.

    Plugin Contributor iSaumya

    (@isaumya)

    OK. Let me know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WPStatistics compatibility’ is closed to new replies.