• Plugin Contributor iSaumya

    (@isaumya)


    Hi @salvatorefresta,
    First of all thanking for keep making this plugin awesome but I do have a few questions about the v4.2.x release. I hope you can answer them and this will also help others in future if they are looking for an answer to a similar question.

    1. What’s the benefit of using Cloudflare worker over using page rules? Is there any speed improvements or percentage of cache hit increases? Why you opted to use workers over page rules?

    2. In the Cloudflare worker free more CF gives daily 100,000 read-write access. But if a site has more traffic than that, then they need to pay 5$/mo to get the uplomed worker plan where they will get 1000,000 read writes and then after that 50 cents per 1 million requests? Check: https://i.imgur.com/fGDGp6L.jpg
    I have many clients with high traffic websites, some are already using the pro plan, so should I ask them to pay 5$ more for getting the worker 10 million plan?

    3. Is the worker code hosted on our Cloudflare account or you have the worker setup on your end and we are simply connecting to it?

    4. Is it going to perform only read requests or there are any write requests as well performed by the worker? I mean what kind of operations the workers are making so that if we go with the worker paid plan, we can have some idea about the charges.

    5. Is it a good idea to use the worker on all websites over using the page rules?

    6. If the worker code is present in each different cloudflare account locally instead of pointing to a global worker that you have setup, in the future updates of the plugin if you change the worker code, will it auto update in the cloudflare account?

    If you could answer the couple of questions above, I hope that will be helpful for all.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I also would like to know which setting is better to sue: page rules or workers.

    My take on some of your questions, as I’ve been interested in CF Free and Workers for some time.

    1. The most important thing IMO that Workers offer more than Page Rules is cookie-bypass that isn’t supported in the free account. Taken from Worker’s code:

    // Default cookie prefixes for cache bypassing
    const DEFAULT_BYPASS_COOKIES = [
        "wp-",
        "wordpress",
        "comment_",
        "woocommerce_"
    ];

    That said, Workers are just plain JS against the CF API. The level of sophistication of your Workers code is up to you, which can be well beyond anything Page Rules could ever offer, free or paid.
    3. Workers are always hosted and executed at CF. This plugin just uploads their own Workers code up there.
    6. Not sure I understand your question. Workers are executed per route. The code itself has global scope, but you set the route/domain that restricts where will it apply.

    HTH.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @alx359,
    We use Cloudflare Workers almost on all of our projects as we love using it due to it’s power. We mostly use CF workers for doing edge level redirections, adding security headers etc. In fact we have even wrote an article about it which you can read here.

    So, I’m well familiar with how workers work. But my question was Page Rules are also deployed to each edge nodes and runs on every request before generating a response. So, if we can achieve the same with page rules (which are free and doesn’t have usage-based pricing), why should anyone use a worker to achieve the exact same result using worker?

    As worker has usage-based pricing for high traffic sites, it can be costly. Also, if page rule and worker are giving me the exact same result why should I use worker for it? I mean I think it is wiser to use page rule for it and then if you need you can write crazy logics using workers and deploy it in your route. As one specific route can hold only one worker.

    I hope this clarifies the question a bit. If there are some extra benefits of using worker over page rules for caching, then I can understand. But now even with page rules, you can still not cache pages using this plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Some Questions About the Cloudflare Worker in v4.2.x’ is closed to new replies.