• Resolved Nate

    (@goseongguy)


    Hello! I’ve made the switch to this plugin and it seems quite nice! However I’m still trying to figure a few things out.
    1. I’m on CF free plan, and I had 3 custom page rules before activating the plugin. For Worker mode, is it alright that I left the 3 existing page rules there? I didn’t need to delete one of the page rules to make space for any rules the plugin would use, correct? As I understand, if using the default page caching mode, only then I need to clear out a page rule for the plugin to use, but not for Worker mode?

    2. I read that the plugin automatically bypasses cache for admin. I assume this is for both default and Worker modes. Does it do this for *preview=true* also? (If so then I can remove these page rules.)

    3. The reason I verify things are ok with page rules is that I’m trying to update my child theme’s functions.php and style.css files. The pages seem to be caching ok but I can’t seem to get the updated style.css file after purging the whole CF cache and my browser cache. Settings I’ve enabled are preloading, fallback cache, and browser cache (in Worker mode). Am I doing things right?

    Many thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Nate

    (@goseongguy)

    [comment removed by me]

    • This reply was modified 3 years, 7 months ago by Nate.
    Plugin Contributor iSaumya

    (@isaumya)

    1. I’m on CF free plan, and I had 3 custom page rules before activating the plugin. For Worker mode, is it alright that I left the 3 existing page rules there? I didn’t need to delete one of the page rules to make space for any rules the plugin would use, correct? As I understand, if using the default page caching mode, only then I need to clear out a page rule for the plugin to use, but not for Worker mode?

    – Yes if you are using the worker mode then you can keep your existing page rules. But make sure none of those page rules modify cache of the website where you are installing this plugin. Only the worker or page rule added by the plugin will handle the cache for that website. But you can use the page rules for other things like forwarding URLs.

    2. I read that the plugin automatically bypasses cache for admin. I assume this is for both default and Worker modes. Does it do this for *preview=true* also? (If so then I can remove these page rules.)

    – Yes for both page rule and worker mode. It’s totally out of the box. You don’t have to do anything special.

    3. The reason I verify things are ok with page rules is that I’m trying to update my child theme’s functions.php and style.css files. The pages seem to be caching ok but I can’t seem to get the updated style.css file after purging the whole CF cache and my browser cache. Settings I’ve enabled are preloading, fallback cache, and browser cache (in Worker mode). Am I doing things right?

    – Have you tried incognito mode? Also, reconfirm that the style file has actually been updated on the server.

    Thread Starter Nate

    (@goseongguy)

    Thank you @isaumya. I know something is not right because I did all of the following together:

    * Purge all caches several times, including CF and browser cache
    * Disable the full page caching on the plugin
    * Enable development mode on Cloudflare
    * Pause Cloudflare on my site

    Even just ONE of these should do it, but I am doing ALL of the above together, but when I run a report on GTM for example, it shows a cf-cache-status: HIT for the HTML page, which is impossible.

    After a long time of trying so many things, I finally see it in my browser, but why does GTM still get a HIT? I did re-enable a page rule after disabling everything for my wp-content/uploads which sets a Browser Cache TTL and an Edge Cache TTL, but it’s turned off now with all of the above, and not sure that would even matter. I never had this problem before with my previous cache plugin on GTM and never had to touch any page rules, CF dev mode, pause CF, etc.

    Even if I change the server source location in GTM to a country/city I’ve never tested from before, it STILL reports the HTML as a hit. I will keep investigating, it makes no sense to me.

    • This reply was modified 3 years, 6 months ago by Nate.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    I don’t have your site url so I can’t check it on my end. But your Cloudflare existing pagerules/workers might be the issue. Try disabling all page rules and workers yu have for this domain and then set the plugin. Let the plugin add it’s own p[age rule or worker based on the option you choose and do not tinker with that. It should work. Also under CF settings under cache make sure browser cache is set to “Respect Existing Headers”

    Thread Starter Nate

    (@goseongguy)

    Okay. I disabled the plugin and Cloudflare. I deactivated my page rules. No other worker code. Then I activate the plugin. Respect Existing Headers was already set.

    I still haven’t been able to figure out how to see updates to my site (for normal front-end users) while using this plugin. I clear the cache over and over again via the plugin, via my Cloudflare account. I clear browser cache. I enable development mode. I even check a family member’s phone. Old content stays, for maybe a day or two, who knows, whenever it decides it’s ready to show new content.

    Your support has been great, but I may have no choice but to leave a poor review for the plugin, with impossibility/unpredictability to clear/bust the cache.

    Plugin Contributor iSaumya

    (@isaumya)

    Have you watched this video present in the plugin description: https://www.youtube.com/watch?v=c-U5Nw2xTj8&feature=emb_title

    If not watch it it shows you everything. Even how can you check if cache is working using your chrome dev tools network tab.

    Thread Starter Nate

    (@goseongguy)

    Just to check…would this line in the logs when I attempt to clear cache be any cause for concern? I assume there’s nothing wrong with this:

    [2021-05-16 01:28:27] [cloudflare::get_cloudflare_cookie] No cookies found in response HTTP packet

    I’ve been doing as the video does and it says it’s working and caching. The issue is busting the cache. My site is stuck with old content staying cached, or failure to purge, with this plugin.

    • This reply was modified 3 years, 6 months ago by Nate.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi @goseongguy,
    I just checked the code and can confirm that this should not cause any issues as this is simply checking for the Cloudflare cookie __cfduid which has recently been deprecated by Cloudflare. I’m looking into the codes to remove that cookie check in the future updates.

    The issue is busting the cache. My site is stuck with old content staying cached, or failure to purge, with this plugin.

    – Are you using the page rule mode? If so, the cache buster query string will be added at the end of the URL i.e. ?swcfpc=1. When that query string is present in a URL, you can check the network tab and you should see for the first request the cache control is no-cache and Cloudflare is bypassing that page from caching.

    Do, note this cache buster will only be shown to the logged-in users and not normal users. In case you do not like to see that cache buster query string, you can always enable the worker mode, which will not use any cache buster query string and bypass the cache when needed.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Existing page rules and Worker mode’ is closed to new replies.