• Resolved indyparker

    (@indyparker)


    Hi Hector,

    Hope you are well.

    We have been using your plugin for many years now and one problem that has always hit us is related to caching.

    Now we have moved to a host which has configured our CloudFlare Enterprise caching and local caching with WP-Rocket and their own server cache for speed and performance, we not that WPP is no longer showing us the ‘correct’ views – hence impacting our TRENDING and POPULAR posts widgets which use your plugin.

    i.e.

    Homepage

    https://shorturl.at/pwDV2

    TRENDING (WPP)

    https://prnt.sc/lOLMkzqCmQUM

    WP Dashboard:

    https://prnt.sc/t-GDNMTWhVJd

    This number as always been higher 1000+

    The only way we have addressed this is to keep on clearing all the cache – which is not a desirable fix at all -because we then lose all our performance gains from the CF and local caches.

    We do have Redis and Object Cache Pro installed as well.

    The hosting company asked this question to assist with the issue:

    “I would agree having to clear the cache each time would not be ideal, what would need to happen is the plugin would need to use an Ajax call, so the page can be served by cache but the Ajax function allows that section to remain dynamic and update in real time while not having to clear the cache.? If that is not a possibility then clearing cache is the only option in which we need to see if the plugin has some kind of hook we can listen to, to know when to clear the cache.

    Can you please suggest how we can fix the above? Do you have an example of the Ajax call?

    We use 3 WPP widgets – one for the homepage – TRENDING:

    https://shorturl.at/pwDV2

    and two for ‘Popular’ and ‘Trending’ on the sidebar of posts (which currently need CSS fixes) e.g.

    https://shorturl.at/eipX2

    Your help with this will be hugely appreciated.

    Regards,

    Indy

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @indyparker,

    From what I can see, your Trending section is already loading via AJAX so there’s nothing you need to do on that end.

    The one thing you will want to check is your CF / local page expiration time. These caches should be renewed at least once every 24 hours (I recommend every 12 hours) so stuff like WordPress nonces (which WPP uses) work as intended.

    As per “not showing the correct views” issue, I’m not sure what exactly that means. Sounds like you’re comparing the views count you’re seeing on the At-a-Glance section vs… Google Analytics? Something else? (I’m guessing you’re getting that “+1000 number” from somewhere?)

    Thread Starter indyparker

    (@indyparker)

    Hi Hector,

    Thanks for your reply.

    I shall forward your point about CloudFlare to the hosting company.

    Is this Wiki section

    https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance

    You mention a few things. Is there anything we need to do from this?

    With regards to the ‘Views’ display – this has always been present when we have WPP enabled.

    https://prnt.sc/L4I7UgIM6fFV

    We only use WPP for the views, nothing from GA comparisons. This figure begins to rise as soon as caches are cleared and it can be 1000+ when this is the case, thus, reflecting more hits on the server, than missed due to the cache.

    Therefore, what we need for our WPP popular posts to show is a more realistic views figure, which gets reduced as the caches begin to populate.

    Plugin Author Hector Cabrera

    (@hcabrera)

    This figure begins to rise as soon as caches are cleared and it can be 1000+ when this is the case, thus, reflecting more hits on the server, than missed due to the cache.

    Ah, in that case yeah this might be a caching problem.

    As I suggested on my previous comment, please make sure that your caches (both the local one and CloudFlare’s) expire at least once per day (ideally every 12 hours) to make sure that WPP can track visits more reliably (the need for this is explained here: Is WordPress Popular Posts compatible with caching plugins?, second bullet).

    Thread Starter indyparker

    (@indyparker)

    Hi Hector,

    Thanks for your reply.

    Okay, I will forward the link(s) to the hosting team to see what the next steps will be.

    If they have more questions, I shall contact you.

    Regards,

    Indy

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CloudFlare Cache and Hosting Cache’ is closed to new replies.