-
Notifications
You must be signed in to change notification settings - Fork 632
Wordpress + CF Worker #41
Comments
Also, I noticed that |
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. |
You shouldn't need a Edge Cache TTL page rule. I'd recommend Keeping the
Cahce Everything and adding "Origin Cache Control" to it though. That tells
the CF edge to honor the caching headers from the origin (for things other
than the HTML that the worker takes care of).
…On Fri, Aug 2, 2019 at 9:40 AM willstocks-tech ***@***.***> wrote:
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: image]
<https://user-images.githubusercontent.com/43744514/62373803-7a846500-b532-11e9-84d9-5ee10ee8ba2e.png>
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: image]
<https://user-images.githubusercontent.com/43744514/62374207-5a08da80-b533-11e9-868a-cd856eaa4ba9.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#41>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADMOBM6PPK56QII2KKAON3QCQ2NXANCNFSM4II4T43Q>
.
|
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? |
The service-worker and Cloudflare worker should iteroperate fine. As far as
the SW is concerned, the CW is just the web server serving the content.
Think of it more like a version of W3TC, just running at the edge.
…On Fri, Aug 2, 2019 at 9:54 AM willstocks-tech ***@***.***> wrote:
Thanks @pmeenan <https://github.com/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?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADMOBMWSE3NYZJD3VHDC33QCQ4DHANCNFSM4II4T43Q>
.
|
Thanks @pmeenan - is it worthwhile me disabling W3TC Page Caching (only, object, database and browser would still remain) in place of the provided plugin? |
You can try and see if the headers start working. If so then the CF edge
should absorb just about all of the traffic that the page case would be
serving and it might be better to have it off.
…On Fri, Aug 2, 2019 at 10:00 AM willstocks-tech ***@***.***> wrote:
Thanks @pmeenan <https://github.com/pmeenan> - is it worthwhile me
disabling W3TC Page Caching (only, object, database and browser would still
remain) in place of the provided plugin?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADMOBN4VWPUYMRJIF3O4T3QCQ4WTANCNFSM4II4T43Q>
.
|
Have disabled W3TC cache and now I'm seeing the following on my home page consistently.
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 ( |
That would be awesome if they built a direct integration (or published
their own worker to use).
…On Fri, Aug 2, 2019 at 11:42 AM willstocks-tech ***@***.***> wrote:
@pmeenan <https://github.com/pmeenan> also FYI:
https://wordpress.org/support/topic/potential-support-for-cloudflare-worker-caching-plugin/
:D
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADMOBLPBTVZVNNULTT2KJLQCRIXLANCNFSM4II4T43Q>
.
|
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 😞 |
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. |
Hello!
So I just setup a CF Worker using the provided example (see here) and kept everything exactly as-is out of the box.
I am having to use the API config, as I don't have an option for KV storage at the moment (via the Workers tab, or workers.dev)
I'm noticing that most of my requests (https://willstocks.co.uk) are getting the following response headers applied:
But if I look in my Workers stats, I'm seeing requests coming in (both cached and uncached (for the pages that I'm visiting for the first time since implementation)):
![image](https://user-images.githubusercontent.com/43744514/62364848-82380f80-b51a-11e9-8d7e-ccc355812e3e.png)
The
x-html-edge-cache-version
never increments up, despite the fact that I have the plugin installed on my WP site. I'm also not seeing thex-HTML-Edge-Cache
header for some reason?Worth noting, I am also using W3TC on my site, but I'm seeing the headers change on refresh/consecutive visits.
Any ideas? 😁
The text was updated successfully, but these errors were encountered: