Html-Edge-Cache worker is not working anymore

There is this edge cache html worker plugin/code that is developed by a cloudflare team member.

I have successfully added it a few weeks ago, it nicely purged the cache when i added a new post, so i could enable caching for everything, however, for some reason it stopped working (i have been tweaking with my site for a while so i am not sure what caused it)

any reason for why it could have stopped working? Its not in the headers list when i check any page on gtmetrix or pingdom or anything like that.

Thank you so much for your help.

if i remember correctly it was x-html-edge-cache

the site is nullfud(.)com if u need to check gtmetrix

edit: now my domain name has a the x-html-edge-cache header, but no other file does (yes i used /* after the domain)

when i post a new post it doesnt clear the cache (it previously did)

i have tried redoing the worker, disabling wp rocket, and wordfence, nothing helped, i am really thankful for any help.

edit2: also tried non kv workers, didnt help.

So it’s working, but too well, as it’s not clearing the cache.

Do you still have the plugin installed?

1 Like

yes i do (i was waiting for your reply, saw posts related to that with your replies in it, you seem to know how this thing should work)

It’s working fine for me, I get the header “x-html-edge-cache-status: Hit, Refreshed”.

The example avoids the caching when you’re logged in (there’s a Wordpress cookie present) - could this explain it? Test in an incognito window if you don’t want to log out of your main window, then you can test not logged in at the same time.

Also if you’ve got the browser debug tools open (which presumably you do, if you’re checking headers) then make sure that “Disable cache” isn’t ticked on the Network tab, as this sends headers that tells the worker not to use the cache as well.

EDIT: Sorry, I didn’t read through all of your edits properly, this doesn’t really answer your latest question.

I have disabled cache everything, and now i am only caching the wp content folder, this way i have no problems with cache purges on new posts, plus my TTFB seems to have also improved, i get a sub 2 sec (even sub 1 sec sometimes) loading time most of the time, should i just leave it at that? I am not a professional so i am not sure if i can further improve it.

Do the files not suppose to have x-html-edge-cache-status headers, only the main url? I get it on the main url but not for anything under it on the waterfall chart.

Thank you so much for your time!

The page cache worker is specifically for caching HTML content, specifically the mime-type “text/html”. If you look at the example worker (I don’t know if you’ve modified it much) you can see this on lines 61, 175 and 280.