Skip to content
  • GDPR-compliant
  • 100% hosting in Germany
  • Personal contact
  • Support included
  • Provisioning within 24 hours
Error & Status Codes 2 min read

HTTP status code 504 Gateway Timeout: causes and solutions

A brief explanation

A 504 Gateway Timeout means that an intermediary server has waited too long for a response and has abandoned the request. The page isn’t broken - it’s simply that a process behind the scenes is taking too long.

What does status code 504 mean?

As with the 502, a web server, proxy or CDN is involved as an intermediary. With a 504, however, the response from the application server is not faulty, but simply late: the time-out occurred before the script had finished.

Typical causes

  • Computationally intensive scripts, such as imports, exports or the generation of large numbers of images
  • Slow database queries, for example when dealing with large tables without suitable indexes
  • External services that your site queries and which themselves respond slowly - interfaces, payment or delivery services
  • Resource-intensive background tasks that run whilst a page is being loaded - such as WP-Cron in WordPress
  • If a proxy or CDN is in place: a shorter wait time there than on the server

Solution for visitors

  • Refresh the page after a moment.
  • If the error occurs during a specific action, such as submitting a form, check whether the action was actually carried out before trying again.
  • Please inform the site operator if the error occurs repeatedly.

Solution for website operators

  • Identify the slow process: Which URL is affected, and does it happen all the time or only occasionally? The access and error logs can help with this (analyse log files).
  • Outsource time-consuming tasks: Run imports, exports, newsletters or reports via cron jobs or SSH rather than in the browser. In WordPress, replace WP-Cron with a proper cron job.
  • Optimise the database: Clear out legacy data such as revisions or expired entries, and check for slow queries from plugins.
  • Secure external services: Set short time limits for API calls and cache their responses.
  • Use caching: Page caching and - available on request from the Premium plan onwards - Redis as an object cache significantly reduce response times. With ShieldCache, pages are served directly from the HTTP cache, whilst our CDN delivers static files from locations close to your visitors.
  • Check the PHP timeout: Individual settings such as max_execution_time can be customised via a dedicated php.ini file. However, this does not address the root cause - the page will only become faster through the optimisation itself.

Was this article helpful?

New to SpeedIT Solutions?

Hosting where you know someone.

What you are reading here is what we put into practice for our customers every day. Based in Isernhagen since 2009 - with dedicated contact persons rather than a call centre.

  • 100% hosted in Germany
  • GDPR-compliant
  • Dedicated contact person
  • Provisioning within 24 hours
4.9 88 reviews on Expeero

SpeedIT Solutions - Super IT Provider

SpeedIT Solutions - Super IT Provider Sehr gute Unterstützung, top Erreichbarkeit, supergünstige Preise, beste Qualität, sehr zu empfhehlen.
Peter S.Recommends us · 08/07/2026

100 % recommend us · Expeero

All reviews on HOSTtest (opens in a new window)

You might also be interested in:

Personal support

Of course, our support team is also happy to assist you personally. If you cannot find what you are looking for in our knowledge base or require personalised support, please do not hesitate to contact us. We’re here to help you and to ensure that your experience with our products and services is as smooth and enjoyable as possible.