• Resolved maxsteelz

    (@maxsteelz)


    Hi Saumya,

    I like your plugin and was wondering if you could guide me in the right direction to solve the problem i am facing. I am using free Cloudflare account and have downloaded your plugin and enabled page caching after entering the API token details etc and enabled page caching.

    – Click on test caching says it’s working fine
    – On Cloudflare dashboard i could see page rule created automatically to cache everything.

    When i check on gtmetrix i get a score of B and it does show cache as HIT, however after couple of hours it mysteriously show cf-cache: expired and the score drops to F. I thought perhaps it could be due to the page rule so i enabled the Worker option in the plugin and a worker rule has been created automatically yet the issue remains same. It works for some time and again after a while cache is shown as expired.

    Perhaps i am doing something wrong and would appreciate if you could help me figure this out so i can enjoy the benefits of this plugin. In case you need any other information like screenshots for any settings etc do let me know.

    Many thanks

    Max

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

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

    (@isaumya)

    Hi,
    I totally understand your problem but after checking your site I can say that the page caching is working properly on your site and pages are being served from Cloudflare CDN.
    Screenshot: https://i.imgur.com/yZWwwmg.jpeg

    View post on imgur.com

    I can even see that you are using the worker mode – which is great. But if your website doesn’t require normal users to login to the website, you can stick with the page rule mode if you like – as page rules are 100% free.

    Now coming to the Cache MISS/EXPIRED/DYNAMIC issue you have mentioned above – honestly, it is a normal thing – as Cloudflare will not keep items in the Cache if it does not have much traffic to it.

    This is why I will recommend you to do these 2 things:
    1. Inside your cloudflare dashboard – enabled Smart Tiered Cache
    2. If you can get the Cloudflare Cache Reserve (More Info: https://blog.cloudflare.com/introducing-cache-reserve/) – though it is not free but trust me it work every single penny and going to increase your cache HIT ratio massively.

    If you want to learn more about Cloudflare caching behaviour, check: https://acnam.com/untold-truths-of-cloudflare-cdn/#cloudflare-cache-creation-replication-storage

    P.S.: Also do enable the option inside the plugin settings to add the proper cache control header for the static files: https://i.imgur.com/1oJeuXr.jpeg

    • This reply was modified 2 years, 5 months ago by iSaumya.
    Thread Starter maxsteelz

    (@maxsteelz)

    Hi Saumya,

    Thank you for your response.

    Well the idea to use Cloudflare worker was to avoid seeing the swcf in the url also i plan to use this with Woocommerece. My understanding is that worker will work better compared to the page rule. Please correct/guide me in case i got this wrong.

    Now coming to the Cache MISS/EXPIRED/DYNAMIC issue you have mentioned above – honestly, it is a normal thing – as Cloudflare will not keep items in the Cache if it does not have much traffic to it.

    There is hardly any traffic on the website and it’s just me testing things. No wonder cache keeps getting expired. By the way before responding back i checked again to to confirm with Gtmetrix and again got a score of E with cache expired. At least now i know the reason that without much traffic CF is not serving it.

    Smart tiered cache was already enabled. About cache reserve – it says apply for beta testing since i am on a free plan i guess this feature will not be applicable.However i have another option there ( Some new settings enabled by cloudflare beta testing) called cache rules and over there i have added a rule according to which if uri is a match then make it eligible for caching. Let’s see if this works similar to cache reserve and does the trick or not.

    P.S.: Also do enable the option inside the plugin settings to add the proper cache control header for the static files: https://i.imgur.com/1oJeuXr.jpeg

    This option i had enabled previously before posting here. So its been there all his while you tested.

    Thank you once again for your prompt reply and support. I will let you know how it behaves with the new caching rule enabled. Honestly if a website is receiving less traffic not sure using Cloudlfare is a good idea? because it empties the cache defeating the whole purpose.

    Thanks
    max

    Plugin Contributor iSaumya

    (@isaumya)

    Well the idea to use Cloudflare worker was to avoid seeing the swcf in the url also i plan to use this with Woocommerece. My understanding is that worker will work better compared to the page rule. Please correct/guide me in case i got this wrong.

    – Yes if you plan to use WooCommerce or any eCommerce based solution where normal users can also login then definitely go with the Worker mode.

    About cache reserve – it says apply for beta testing since i am on a free plan i guess this feature will not be applicable.

    – You can apply for the Beta and as soon as they accept your application you can start using it. Cache Reserve can be used by any user on any plan.

    i have another option there ( Some new settings enabled by cloudflare beta testing) called cache rules and over there i have added a rule according to which if uri is a match then make it eligible for caching. Let’s see if this works similar to cache reserve and does the trick or not.

    – No it won’t. Cache rule is for caching login and not for holding your cache in the server. For that you need Cache Reserve if you want your cache to remain on the server whether it received traffic or not.

    Honestly if a website is receiving less traffic not sure using Cloudlfare is a good idea? because it empties the cache defeating the whole purpose.

    – Yes it defiantly is. But on sites with less traffic Cache Reserve becomes highly effective and cost even less. So, I will highly recommend using that along with smart tiered cache.

    Hello

    I hope that this won’t be considered a hijack of maxsteelz’s enquiry but I thought I would reply to this rather than open a new support ticket is because I’m experiencing very similar problems but with additional caveats:

    I’m actually am using the Cloudflare Cache reserve with Tiered cache because like maxsteelz I have a low traffic site so this should be the perfect solution to ensure that my content is always cached by Cloudflare.

    I can also confirm that I’m using Apache as the web server & I’ve also changed the plugin settings to add the proper cache control for static files as you instructed here: (ie “P.S.: Also do enable the option inside the plugin settings to add the proper cache control header for the static files: https://i.imgur.com/1oJeuXr.jpeg”)

    Furthermore I believe I have implemented all the instructions detailed here to ensure that WP Super Page Cache interacts correctly with WP Rocket (ie https://gist.github.com/isaumya/d5990b036e0ed2ac55631995f862f4b8)

    After opening all the pages on my website I’ve then tested it on GTMetrix & received a cf-cache-status of `HIT’ for the HTML & all the static files, thus all good at this stage.

    However, when I test again 2 or more hours later, whilst the HTML element retains a cf-cache-status of HIT', the static elements like images change to a cf-cache-status ofEXPIRED’.

    Am I doing something wrong ?

    Many thanks

    Kevin

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @budpierce,
    If you have CF Cache Reserve enabled then this should not be happening. Can you try disabling WP Rocket for a few days and see if the issue persists or not? Do let me know. As you haven’t shared your site URL I cannot check it on my end here.

    Hello Saumya

    Thank you for your response.

    I’ve done exactly what you asked & disabled WP Rocket for a few days. I still haven’t been able to retain a cf-cache status = HIT for more than a few hours with most elements.

    As a result, I cleared the Cloudflare cache again 24 hours ago, warmed everything up & achieved the following results on GT Metrix for 2 pages:

    https://gtmetrix.com/reports/www.kernowdirectmarketing.co.uk/NfrOb1Dg/

    https://gtmetrix.com/reports/www.kernowdirectmarketing.co.uk/IyGOM1QC/

    As you can see, I’m getting a CF-cache status = HIT on all the assets that should be cached.

    I’ve just rerun the reports of GT Metrix for those 2 pages 24 hours later: Here are the results

    https://gtmetrix.com/reports/www.kernowdirectmarketing.co.uk/sVZ6cs1O/

    https://gtmetrix.com/reports/www.kernowdirectmarketing.co.uk/t9h6NpFJ/

    As you can see, I’m getting lots of `misses’. Indeed, on one page I even get a miss on the HTML element.

    Here are the stats from Cloudflare. Bear in mind that this site is not live & not indexed by Google therefore traffic is very low:

    Overview for last 24 hrs
    Total Requests
    2.17k

    Percent Cached
    78.17%

    Total Data Served
    23 MB

    Data Cached
    18 MB

    Cache Reserve

    Cache sync:
    Cached assets are being copied to a storage bucket

    Current data stored:
    2.7 MB
    1 Oct – 11 Oct usage for kernowdirectmarketing.co.uk

    Aggregate storage usage:
    5.53 MB-days
    Read operations:
    0
    Write operations:
    0

    Hope this helps

    Thanking you in anticipation

    Kevin

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @budpierce,
    I have looked at the waterfall chart of all 4 links you have mentioned above. But honestly, I have no idea why this is happening. Cause as you said you already have Cache Reserve in place. So, this should not be happening unless you are purging the cache.

    But you are not purging the cache and WP Rocket is disabled so it is also not causing any cache purge. This is really wired.

    I will suggest you contact Cloudflare and ask them why is this happening. As you already have Cache Reserve so items should remain in the cache. Let me know what insight they provide.

    Thanks for your prompt reply Saumya. I’ll keep you updated

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CF-CACHE Expired’ is closed to new replies.