Support » Plugin: Super Page Cache for Cloudflare » Site not caching

  • Resolved fabl3

    (@fabl3)


    Hello,

    When I hit the TEST CACHE button I receive the following error:-

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

    Error on dynamic page (https://fableandguild.com): Invalid Cache-Control response header. If you are using Litespeed Server, please disable the option Overwrite the cache-control header for WordPress’s pages using web server rules, purge the cache and retry.

    Error on static resource (https://fableandguild.com/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Cache status: BYPASS – Cloudflare has been instructed to not cache this asset. It has been served directly from the origin.

    Please check if the page caching is working by yourself by surfing the website in incognito mode ’cause sometimes Cloudflare bypass the cache for cURL requests. Reload a page two or three times. If you see the response header cf-cache-status: HIT, the page caching is working well.

    I have checked my Respone-Headers in FireFox (in a Private Window and not logged in) and have the following entries:-

    Cache-Control: s-max-age=604800, s-maxage=604800, max-age=60
    Cache-Control: private, must-revalidate
    CF-Cache-Status: BYPASS

    As a bit of background I set up CloudFlare a few days ago and used the rules based recommendations for WooCommerce (from CloudFlare) where I set 3 rules. The CloudFlare WP Plugin was also installed.

    I found your excellent plugin when searching around and have installed it. The extra rules have been removed in CloudFlare, other than the one created by the plugin to Cache All. The CloudFlare Plugin is Deactivated. Also I deactivated the caching in WP-Optimize that I was using prior to CloudFlare and have activated the Enable fallback page cache in WP Cloudflare Super Page Cache.

    I have PerfMatters plugin installed and tried deactivating that, but no change. WP-Optimize now just does Db and minification.

    I am using Bluehost (the Single-Server Caching Control option is Off) and running on Apache v2.4.46.

    Any ideas as to why I might not be caching correctly in CloudFlare?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter fabl3

    (@fabl3)

    I have now managed to remove the CF-Cache-Status: BYPASS I was getting previously in the response headers. Unfortunately I still get an error from the TEST CACHE button:-

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

    Error on dynamic page (https://fableandguild.com): Seem that your website is not behind Cloudflare. If you have recently enabled the cache or it is your first test, wait about 30 seconds and try again because the changes take a few seconds for Cloudflare to propagate them on the web. If the error persists, request support for a detailed check.

    Error on static resource (https://fableandguild.com/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Seem that your website is not behind Cloudflare. If you have recently enabled the cache or it is your first test, wait about 30 seconds and try again because the changes take a few seconds for Cloudflare to propagate them on the web. If the error persists, request support for a detailed check.

    Please check if the page caching is working by yourself by surfing the website in incognito mode ’cause sometimes Cloudflare bypass the cache for cURL requests. Reload a page two or three times. If you see the response header cf-cache-status: HIT, the page caching is working well.

    Is this related to the way that Bluehost integrates with Cloudflare, where you do not change your DNS servers to point to the Cloudflare DNS servers directly?

    After checking my Respone-Headers in FireFox (in a Private Window and not logged in) and have the following entries:-

    cache-control: s-max-age=604800, s-maxage=604800, max-age=60
    cache-control: private, must-revalidate

    Thread Starter fabl3

    (@fabl3)

    Ok, I have now managed to get rid of the:-

    cache-control: private, must-revalidate

    This was being set in the .htaccess file by WP-Optimize Cache setting as part of the browser cache settings, which seemed to remain on when Caching was off.

    I now have this in the response-headers:-

    cache-control: s-max-age=604800, s-maxage=604800, max-age=60
    cache-control: max-age=14400
    cf-cache-status: DYNAMIC

    Any thoughts on how to get the cf-cache-status from DYNAMIC to go to HIT?

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi @fabl3,
    Can you check inside your Cloudflare dashboard if the Development Mode is enabled or not? If so please disable that and also take a look at the htaccess again to ensure there is no more unnecessary cache-control overwrite as you mentioned by WP Optimize.

    Cache-Control header should only be handled by this plugin only.

    Also, I see an x-endurance-cache header in your site response. Please remove the endurance cache from your site. It must be added as a must-use plugin. So, disable it first and then delete it from the /mu-plugins/ directory.

    Moreover, you can easily use perfmatters with this plugin. You just have to ensure that you do not use any other disk caching or CDN caching system when using this plugin. But you can always use plugins for static files like css, js, image file optimization.

    Let me know.

    Thread Starter fabl3

    (@fabl3)

    Hello @isaumya

    Many thanks for the prompt response and recommendations. I have checked the Development Mode in Cloudflare and that is off.

    In Bluehost their cache is already turned off and Cloudflare caching is enabled in the Performance tab. The Cloudflare CDN Caching Control is set to “Ecommerce”. I have renamed the Bluehost endurance cache in my mu-plugin folders and will test.

    I will use Perfmatters moving forward for minification and DB tuning and keep WP-Optimize disabled.

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi @fabl3,

    The Cloudflare CDN Caching Control is set to “Ecommerce”.

    Where is this option? Can you send me a screenshot? I have not seen such option in Cloudflare dashboard.

    I have renamed the Bluehost endurance cache in my mu-plugin folders and will test.

    Don’t rename the file. Simply delete the file from the server while keeping a local copy of the file.

    Thread Starter fabl3

    (@fabl3)

    Hello @isaumya,

    Many, many thanks for the further assistance, I have now deleted the endurance cache file. I find it amazing that it was turned off in the UI, but being set in the backend, so thanks for that.

    With respect to:-

    The Cloudflare CDN Caching Control is set to “Ecommerce”.

    It is a setting within Bluehost, not Cloudflare. It is found on the Bluehost performance page for your site. You have a choice of their cache (Endurance Cache) or Cloudflare, then you select the type of site you are hosting. See the interface here https://postimg.cc/MMYwymvY.

    Now with the TEST CACHE button I am now seeing a successful response “Page caching is working properly”. In the response headers i am still seeing:-

    cf-cache-status: DYNAMIC

    is this correct?

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi @fabl3,

    It is a setting within Bluehost, not Cloudflare. It is found on the Bluehost performance page for your site. You have a choice of their cache (Endurance Cache) or Cloudflare, then you select the type of site you are hosting. See the interface here https://postimg.cc/MMYwymvY.

    – This is really dumb. I think these Bluehost settings is overwriting the Cloudflare settings in some way. Is there a way to choose none of those options? Also if you Cloudflare account connected with your Bluehost account? If so disconnect it. I think the Bluehost is tinkering with Cloudflare settings. Nothing is supposed to tinker with Cloudflare settings.

    This plugin just one-page rule and changes one setting. Rest settings are not overwritten by anyone. You need to go inside the Cloudflare dashboard to change them.

    But here Bluehost is tinkering with it. Also while looking at the response headers of your website I see 2 cache-control header. One of them is being added by this plugin and the other is cache-control: max-age=0. Figure out what is adding that cache-control header and remove it.

    Screenshot: https://i.imgur.com/7GtrbJB.png

    Thread Starter fabl3

    (@fabl3)

    Hello @isaumya,

    Sounds like it is best to start afresh and remove the Bluehost specific Cloudflare integration and do it manually.

    I will switch to the Bluehost Endurance cache setting (instead of Cloudflare) and ensure it is off. Now with the mu-plugin deleted, that should not give an issue with extra additional cache parameters.

    I can switch the DNS servers directly to the Cloudflare ones and it might be best to delete my current Site under my Cloudflare account and start again, as I am not sure what Bluehost will have added to its config. I created the Cloudflare account prior to running the Bluehost integration wizard, so I hope they have not added any further parameters to it.

    I will let you know how it goes. Thanks again for all your time and invaluable assistance on this.

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi @fabl3,
    Yes, I think that would be best. Just make sure Bluehost doesn’t interfere with your website caching or Cloudflare in anyways. Also, ensure nothing else adds the cache-control header for your website besides this plugin.

    Thread Starter fabl3

    (@fabl3)

    Hello @isaumya,

    I have now reset to Cloudflare and removed all of the Bluehost managed implementation, so I manually added the DNS servers in Bluehost and did not use their install wizard.

    My site is now back with the error message on using the TEST CACHE button:-

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

    Error on dynamic page (https://fableandguild.com): Seem that your website is not behind Cloudflare. If you have recently enabled the cache or it is your first test, wait about 30 seconds and try again because the changes take a few seconds for Cloudflare to propagate them on the web. If the error persists, request support for a detailed check.

    Error on static resource (https://fableandguild.com/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Seem that your website is not behind Cloudflare. If you have recently enabled the cache or it is your first test, wait about 30 seconds and try again because the changes take a few seconds for Cloudflare to propagate them on the web. If the error persists, request support for a detailed check.

    Please check if the page caching is working by yourself by surfing the website in incognito mode ’cause sometimes Cloudflare bypass the cache for cURL requests. Reload a page two or three times. If you see the response header cf-cache-status: HIT, the page caching is working well.

    I am seeing the “cf-cache-status: HIT” now in the Response Headers on Chrome & Edge, but not Firefox, which is weird. Sadly I am still seeing the “cache-control: max-age=0” in the Request Headers on Chrome & Edge. Whereas WooCommerce products have the “cf-cache-status: BYPASS” (the “Product (is_product)” is not selected in the WooCommerce Settings of the Plugin.

    I am using the Aelia Currency Switcher with their https://aelia.freshdesk.com/support/solutions/articles/3000042591 WooCommerce Cache Handler Plugin to handle the caching/currency switching conundrum.

    Any thoughts?

    • This reply was modified 1 year, 7 months ago by fabl3.
    Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi @fabl3,
    Just checked your website and everything seems to be working perfectly.
    Screenshots:

    https://i.imgur.com/4M82I24.png
    https://i.imgur.com/UzStMZV.png

    The single product page should always be Bypassed and cloudflare is now bypassing it is because for the single product page woocommerce cookie is present in the header, looking at which Cloudflare bypass the cache for that page which is a good thing.

    Thread Starter fabl3

    (@fabl3)

    Hello @isaumya ,

    Many thanks for that and all your excellent help on this matter.

    One last question is should I still worry about the “Cache-Control: max-age=0” I am seeing in the Request Headers of the pages?

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Hi @fabl3,
    I do not see the Cache-Control: max-age=0 in the response header of your website. You are only supposed to see it for the pages which are BYPASSED from the cache and not for any other pages. As far as I have seen your site is working fine now.

    Thread Starter fabl3

    (@fabl3)

    Hello @isaumya,

    Many, many thanks for the clarification and all your excellent assistance in getting my site and WP Cloudflare Super Page Cache working together.

    Plugin Contributor Saumya Majumder

    (@isaumya)

    No problem @fabl3. Feel free to share your review in the review section of the plugin. 🙂

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Site not caching’ is closed to new replies.