504 error - Google Fonts workers subrequest in Instant Logs

Our site uses APO on our WordPress installation. As part of APO, Google Fonts are cached on the Cloudflare edge.

I am viewing Instant Logs for our site, and we are getting thousands of 504: Gateway Timeout errors from a workers subrequest. The method is always GET; the URL is fonts.googleapis or fonts.gstatic. (not our origin URLs)

While I haven’t seen an end-user impact, this amount of 504 errors is disconcerting. Is the Cloudflare edge having trouble retrieving from Google servers? How can I resolve this?


I ran into a similar issue in a test APO site, but not from Workers subrequests. I saw 504s returned for some Early Hints requests. If you click on one of your 504s in Instant Logs, can you see the field "ClientRequestSource": "earlyHintsCache"? If so, it may be the same issue that I face, which can be safely ignored.

Hi @kevinlisota

In regards to the 504 edge response status. All of these are associated with edgeWorkerCacheAPI. Please note that these are not actual errors but instead conveys that our cache API cannot find the resource in Cloudflare cache. Also note that, these requests were never made to your origin and only our cache API checking with Cloudflare cache.

Per this documentation Cache · Cloudflare Workers docs

‘The cache.match generates a 504 error response when the requested content is missing or expired. The Cache API does not expose this 504 directly to the Worker script, instead returning undefined. Nevertheless, the underlying 504 is still visible in Cloudflare Logs.’

In the Cloudflare Logs, you may see these 504 responses with the RequestSource of edgeWorkerCacheAPI. Again, these are expected if the cached asset was missing or expired.

1 Like