1 minute content download on initial html file

Am getting an odd one, our site sometimes takes a minute to load, and there’s no reliable way to reproduce the issue. I finally managed to get it to happen while I had to the inspector window, which gave the output below. Exactly 1 minute to download, looks like a timeout to me, but what’s timing out? Why is it so hard to reproduce?

The html file was stuck on this for the 1 minute while it was loading:

image

So it had downloaded effectively all of the html, but it’s almost like the “done” packet isn’t being sent.

Here’s the response headers to show it was a cache hit.

Note that we’re running a cloud worker script which is getting the relevant data from the cache like this:

cache = caches.default;
let contentResponse = await cache.match(cleanUrl);

– then appending Google Font style to the head of based on user agent to ensure fonts load with font-swap.

Our implementation is based on this blog post: https://blog.Cloudflare.com/fast-google-fonts-with-Cloudflare-workers/

Appreciate if anyone has seen something like this before.

Cheers
Paul

If you disable the worker, does the problem go away?

Connecting direct to the server does not appear to have the 1 minute delay

I’ve resolved the issue by removing the google fonts code from our cloud worker script, last month google implemented font-display:swap support so it wasn’t really needed anyway.

This is the second time I’ve had issues with Cloud Worker’s when running the .text() function to pull down the content from an external site for processing. There appears to be an issue in Cloud Worker scripts that causes them to stall for 1 minute and then fail when running response.text(). I’ll need to avoid this feature for the moment, hoping some investigation can be done.

This topic was automatically closed after 30 days. New replies are no longer allowed.