524 A Timeout Occurred
A Cloudflare-specific code: the TCP connection succeeded, but the origin took longer than 100 seconds to respond.
Cloudflare connected to the origin but did not receive a timely HTTP response.
What HTTP 524 A Timeout Occurred Means
Cloudflare connected to the origin but did not receive a timely HTTP response.
A Cloudflare-specific code: the TCP connection succeeded, but the origin took longer than 100 seconds to respond.
Common Causes
- Long-running request or slow database query at the origin
- Origin processing exceeds the 100s limit
- Blocked or stuck application worker
- Missing async handling for slow tasks
How to Fix It (For Visitors)
- Refresh and try again
- Contact the website owner if it keeps happening
How to Fix It (For Developers/Admins)
- Optimize slow endpoints and queries
- Move long tasks to background jobs and return quickly
- Use Cloudflare Enterprise to raise the timeout, or a subdomain bypassing the proxy for long requests
- Add caching
Returning a 524 A Timeout Occurred (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 524 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(524).json({ error: 'A Timeout Occurred' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='A Timeout Occurred'), 524
PHP
<?php
http_response_code(524);
header('Content-Type: application/json');
echo json_encode(['error' => 'A Timeout Occurred']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 524 A Timeout Occurred
Frequently Asked Questions
What does HTTP 524 A Timeout Occurred mean?
A Cloudflare-specific code: the TCP connection succeeded, but the origin took longer than 100 seconds to respond. In short: Cloudflare connected to the origin but did not receive a timely HTTP response.
Is a 524 A Timeout Occurred error my fault or the website's?
524 is a 5xx server-error code, so the problem is on the server side, not your browser or device. As a visitor you can usually only retry; if you run the site, investigate the server.
How do I fix a 524 A Timeout Occurred error?
Optimize slow endpoints and queries. Move long tasks to background jobs and return quickly. Use Cloudflare Enterprise to raise the timeout, or a subdomain bypassing the proxy for long requests.
Official Specification
The 524 A Timeout Occurred status code is defined in Cloudflare (non-standard).