• Resolved dsahai

    (@dsahai)


    Hi,

    Is there anything that I can prevent from caching in order for the plugin to be not cached by Cloudflare and show stale data on my website?

    Thanks in advance!

    • This topic was modified 4 years, 1 month ago by dsahai.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Ajay

    (@ajay)

    The tracking should work with cloudflare as well. But, I don’t think there is anything that can be done to prevent caching of the top posts via Cloudflare.

    How long do you typically cache content with Cloudflare – you’ll need to massively reduce the Expires header (if not mistaken) to something small but not recommended if you have a very busy site.

    https://support.cloudflare.com/hc/en-us/articles/200172516-What-file-extensions-does-CloudFlare-cache-for-static-content-

    Thread Starter dsahai

    (@dsahai)

    Thanks, Ajay!
    That’s what I was worried about. Let me play with the expire headers to find a sweet spot. My site gets a decent amount of traffic but nothing crazy.
    However, I hope you can consider adding some form of cache busting for the list in a future release ??

    Plugin Author Ajay

    (@ajay)

    I have no idea how to do that with Cloudflare.

    Outside of cloudflare, the caching uses transients which by default is 1 hour but can be changed in the settings page

    Thread Starter dsahai

    (@dsahai)

    Thanks, Ajay.
    If you know of any files that I can bypass on Cloudflare (using Page Rules), I’d be happy to try.
    If not, that’s fine too ??
    Thanks again!

    Plugin Author Ajay

    (@ajay)

    the tracking should work through Cloudflare as it uses Ajax. You can toggle to the Query variable method if needed.

    The issue with caching is the top lists, but those don’t have any “files” as it is PHP functions rendered alongside the rest of your site.

    Thinking through this, how bad is the oldness of the posts. The transients are just for an hour so you’re talking at most stale data of one hour. If you’re seeing it longer than that then it’s likely Cloudflare aggressively caching your pages.

    Thread Starter dsahai

    (@dsahai)

    Thanks for your response, Ajay.

    Which query method are you refering to? I have three options

      No query string
      Ignore query string
      Standard

    I really can’t tell the oldness of my posts, I don’t know if there is a way for me check the timestamp of the cache files from Cloudflare. But yes, definitely older than an hour, else I wouldn’t be bothering you ??

    Just for reference, my browser cache is set to 1 day, and Cloudflare edge cache is set to 1 day too. Which makes me wonder if the cache list would refresh once a day?

    Plugin Author Ajay

    (@ajay)

    On query string, I meant the setting in the plugin under Tracker type.

    On caching, I have my cloudflare set to standard so it doesn’t cache ones with a query string e.g. if you’re using the query string tracker.

    In CF, I think the Browser Cache TTL decides the level of caching and you set it as low as you think would make sense.

    https://support.cloudflare.com/hc/en-us/articles/200168276-Understanding-Browser-Cache-TTL

    I checked my site settings in CF, but since I don’t get a lot of hits, I’ve actually let this to be a much much longer duration.

    Thread Starter dsahai

    (@dsahai)

    Thanks, Ajay.
    I’ll play around with the edge cache and browser cache settings to find the best mix.

    At this moment, I do feel your plugin is better performing than some of the others.

    Cheers!

    Plugin Author Ajay

    (@ajay)

    Thank you ??

    Do consider a review if you’d like to.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Prevent Cloudflare from caching plugin’ is closed to new replies.