• zumine

    (@zumine)


    I’m searched this forum and Cloudflare’s and I can’t get my head around this issue.

    With Super Page Cache for Cloudflare active I can’t pass the Test Cache, always giving me this error:

    Page caching seems not working for both dynamic and static pages.

    Error on dynamic page (https://upatm.pt): Cache status: BYPASS – Cloudflare has been instructed to not cache this asset. It has been served directly from the origin.

    Error on static resource (https://upatm.pt/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Unable to find the Cache-Control response header.

    I’ve searched this forum and tried several solutions, including deactivating and deleting the plugin, but nothing worked.

    The weirdness is greater when I realize that at least this specific page that I entered in the form is loading an old version no matter what I do, even using “development mode” in Cloudflare, emptying browser caches, incognito mode, nothing works.. it’s as the cache is coming from there server itself but that is not possible since I’m on o shared hosting who does not provide caching.

    Can you please try and solve this conundrum?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,

    First coming to the home page of your website i.e. https://upatm.pt/ – I can see that the cache status is set to BYPASS despite having proper response headers: https://i.imgur.com/mQUM5Aj.jpeg

    I do see that there is a header showing that you have some other server level page caching system in place, so if possible try disabling that as it is not recommended to have more than one page caching solution for any website.

    Now coming to why it’s BYPASS, I want you to share the following screenshots:

    1. Screenshot of the Page Rule section from your CF Dashboard
    2. If you are using Cache Rules, then share a screenshot of the Cache Rules you have
    3. If you are using Cloudflare Workers to modify cache behaviors, share screenshot of that as well

    Now coming to your /registo/ page, I can see cache HIT here: https://i.imgur.com/WgpC9B8.jpeg

    Interestingly I can see that the server level cache is BYPASSED here. But as this is a registration page, which mostly replies on the server to perform dynamic operations, it’s best to bypass this page from CDN cache.

    You can simply add the /registo/* path to Prevent the following URIs to be cached section inside the plugin settings > cache tab to bypass this page from Cloudflare cache.

    Alternatively, if all the operation of this page is done through Ajax, then maybe you can consider caching this page. Whether or not to cache pages with forms, depends on how the form is handling the data.

    Thread Starter zumine

    (@zumine)

    Thanks for your awesome support!
    First, I must confess that since publishing the thread I’ve tweaked a few things, for which I apologize. I’ve followed your instructions and since then I’m getting a lot more HITs.

    I do see that there is a header showing that you have some other server level page caching system in place, so if possible try disabling that as it is not recommended to have more than one page caching solution for any website.

    This is exactly my thoughts, but I don’t have enough knowledge to figure this out, since I did not implement any other kind of cache system. Can you help me figuring this out?

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,
    You should also enable Smart Tiered Cache inside your CF account dashboard > Caching > Tiered Cache > Enable Smart Tiered Cache which will give you a much higher cache HIT ratio.

    Unfortunately, I won’t be able to help much in terms of server configuration as I have not configured the server, if you have a managed hosting provider, you should contact them or maybe you should consider getting a good managed hosting provider like BigScoots.

    Thread Starter zumine

    (@zumine)

    1. Page rules https://imgur.com/fHkP5An
    2. Cache rules https://imgur.com/aUu7bh3
    3. not using CF workers

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,
    Please share the screenshot of each individual cache rules present in your CF Dashboard.

    Thread Starter zumine

    (@zumine)

    I have enabled Smart Tiered Cache. Unfortunately I’m not able to change provider at this time because of budget.

    On your technical viewpoint, is the cache implemented as is good enough? I’m using Ultimate Member for registrations and WPForo for a forum system.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,
    Yes the cache implementation seems to be good except some issues as mentioned above. Please share the screenshot of each individual cache rules.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,
    I just figured out why your home page is not getting cached via Cloudflare. It’s because of a cookie is being set at the response header level with set-cookie header. Screenshot: https://i.imgur.com/jSYEHyY.jpeg

    When Cloudflare sees cookies being set at the response header level using set-cookie, it will never cache the page regardless of your page rule and cache rules. This is because Cloudflare things that as the page response header has set-cookie header, so the page might be using the cookie value to dynamically generate the page content. Hence, no cache.

    You need to figure out which plugin is adding that cookie and either remove that plugin or contact the plugin author asking them if the plugin can be used without the cookies.

    Honestly, cookies are a very primitive thing as many similar things can be done at the JavaScript level using LocalStorage API which does not create any issues with caching. Similarly, if cookies are created at the JS level, it will also not create any issues. But if the cookies are being set at the PHP level which will use the set-cookie header, your pages will never be cached at Cloudflare CDN.

    Hope this helps. πŸ™‚

    Thread Starter zumine

    (@zumine)

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,
    In this Cache rule: https://imgur.com/pikKwgi you need to replace example.com with upatm.pt.

    Also check this response for the bypass reason: https://wordpress.org/support/topic/cache-never-purges/#post-16782564

    Thread Starter zumine

    (@zumine)

    I just figured out why your home page is not getting cached via Cloudflare. It’s because of a cookie is being set at the response header level withΒ set-cookieheader. Screenshot:Β https://i.imgur.com/jSYEHyY.jpeg

    Oh, I see! So, the culprit is Ultimate Member, but I don’t see any cache options on its settings.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,
    Yes, as I said you need to either stop using that plugin or talk to it’s dev about not using the cookie/finding an alternative cache friendly way.

    Thread Starter zumine

    (@zumine)

    Thanks a lot @isaumya ! Awesome plugin and awesome support!

    Thread Starter zumine

    (@zumine)

    There IS a cache option on the UM plugin settings, which I’ve now disabled. Can I feel happy about my caching setup now?

    • This reply was modified 2 years ago by zumine. Reason: typo
    Plugin Contributor iSaumya

    (@isaumya)

    Hi @zumine,
    The home page of your website is still not being cached due to the cookie. But besides that, you can be happy. πŸ™‚

    Also if you love using the plugin, please consider sharing a review in the review section of the plugin.

    • This reply was modified 2 years ago by iSaumya. Reason: request for review
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Cache never purges’ is closed to new replies.