Git Product home page Git Product logo

Comments (13)

pmeenan avatar pmeenan commented on June 23, 2024 1

I can explain parts of it anyway....

The worker serves the cached HTML immediately and then asynchronously updates the cached version from the origin when it doesn't see the headers from the plugin. That way if the plugin isn't installed and purge isn't working it will still stay up to date. That's what "Hit, Refreshed" refers to. This is likely because of W3TC which serves the HTML from disk directly from the web server and never gets a chance to add the header (which is also why you don't see it). If you are sure the plugin is installed and purging you can disable the code here.

-1 is normal for the version number when KV isn't used and it doesn't change. It is only used with KV.

As far as the worker stats go for subrequests, that's not unexpected if it is refreshing the cahced items. The main dashboard should have a view of the cache hit rate for the top-level requests.

from templates.

pmeenan avatar pmeenan commented on June 23, 2024 1

from templates.

willstocks avatar willstocks commented on June 23, 2024

Also, I noticed that wordpress_test_cookie can also resulting in bypassing of the worker cache

from templates.

willstocks avatar willstocks commented on June 23, 2024

OK, that makes sense! :)

So the plugin is 100% installed and activated on my site... is there a clear and simple way to verify that it is actually doing what it should be doing? In terms of the W3TC page caching, I'm currently using APCu (not Disk) for the page caching:
image

OK, good to know on the -1 front! I'm assuming (although the Cloudflare documentation is a bit inconsistent at the moment) that KV does not come along with the free plan (of which I'm currently using) and requires the paid for workers as a minimum. Some documentation says it's included, other documentation says it's not.

As a slight side note/to clarify - do I also need a page rule applied, to allow for full/optimal functionality or can that now be completely ignored as is replaced in its entirety by the worker (which takes in to account the cookies)?
image

from templates.

pmeenan avatar pmeenan commented on June 23, 2024

from templates.

willstocks avatar willstocks commented on June 23, 2024

Thanks @pmeenan! Updated Page Rule and have applied, will monitor from there as well :)

As an aside, I will log a ticket with the guys at W3TC to see if they can add some form of support for this implementation.

One final question (slightly off topic!), my site runs a service-worker (network first) - is there anything that needs to be included within that so that everything runs perfectly alongside the CF Worker?

from templates.

willstocks avatar willstocks commented on June 23, 2024

Thanks @pmeenan - is it worthwhile me disabling W3TC Page Caching (only, object, database and browser would still remain) in place of the provided plugin?

from templates.

pmeenan avatar pmeenan commented on June 23, 2024

from templates.

willstocks avatar willstocks commented on June 23, 2024

Have disabled W3TC cache and now I'm seeing the following on my home page consistently.

x-html-edge-cache: cache,bypass-cookies=wp-|wordpress|comment_|woocommerce_
x-html-edge-cache-status: Miss
x-html-edge-cache-version: -1

I have just cleared the comment cookies (because I was making sure pages wouldn't cache with comment form data) and I'm still seeing the same on the home page, but now not on the individual post pages (x-html-edge-cache-status: miss, cached) and then hit on next visit

from templates.

willstocks avatar willstocks commented on June 23, 2024

@pmeenan also FYI: https://wordpress.org/support/topic/potential-support-for-cloudflare-worker-caching-plugin/ :D

from templates.

pmeenan avatar pmeenan commented on June 23, 2024

from templates.

willstocks avatar willstocks commented on June 23, 2024

Great news @pmeenan - one of the guys from Cloudflare (CC: @signalnerve) reached out to W3TC as well on the support req. I logged 😁 Very exciting stuff here!!!

As an aside... any idea on why I might just see a straight up "miss" response for my homepage? #41 (comment) - never seems to cache from there-on-in 😞

from templates.

lauragift21 avatar lauragift21 commented on June 23, 2024

Closing this issue because the initial question was addressed. Also the templates have moved over to the worker-sdk monorepo: https://github.com/cloudflare/workers-sdk/tree/main/templates.

if you're still experiencing issues feel free to open an issue there.

from templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.