© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•3y ago
jaan

504 Gateway timeout

Hello, I have a simple CF worker, it takes in a request, checks if it exists in cache.match(), if yes, then return that, if not, then it gets sent to my backend, that response gets put into cache (cache-control comes from backend) and returned.

Everything worked like it should for a while, but suddenly I am now getting 504 Gateway timeout for some requests, even though Origin server is completely healthy.

The 504 error has cache HIT in response headers and it also has a age header that keeps going up. It gets sent back immidiately (request never makes it to origin server).

Any help regards debugging this would be helpful! Is there some kind of special cache logic in CF regards this?
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

504 Gateway Timeouts on Wrangler deploy
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2mo ago
wrangler dev --remote - 504 Gateway timeout after 60s
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
13mo ago
504 Gateway Time-out
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
14mo ago
Scheduled Worker 504 Gateway Time-out
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago