# Site is slow

> Find out why pages load slowly by reading the cache headers, the logs, the PHP settings, cron jobs, and bot traffic, then fix the cause.

Source: https://docs.wpwaterfall.com/troubleshooting-site-slow

A slow site usually has one of four causes: pages that skip the cache, PHP short of memory or threads, a heavy plugin or cron job, or bot traffic. Check them in this order.

## Is the page served from cache?

Open a slow page in your browser's developer tools, or run `curl -I` against it, and read `x-wpwaterfall-cache`.

- `HIT`: the page cache served it and PHP never ran. The delay is in the page itself, such as large images, slow third-party scripts, or many requests.
- `MISS`, `BYPASS`, `STALE`, or `EXPIRED`: PHP built the page. WP Waterfall never caches a page for a logged in visitor, a visitor with items in a cart, a POST, or a response that sets a cookie.

Open **Caching** to check for a path rule that excludes the page and for query parameters that split the cache into many copies. Marketing parameters such as `utm_source` are already ignored. If a plugin sets a cookie on every page, turn on Remove Set-Cookie headers under **Tools**, then clear the cache from **Caching**. Saving cache settings runs a job. See [Edge cache and CDN](https://docs.wpwaterfall.com/edge-cache).

## What do the logs show?

Open **Logs**. `cache-perf.log` shows the cache result for many requests at once. `error.log`, filtered by Error and Warning, shows PHP memory errors and plugin faults. `php-fpm.log` shows what the PHP workers reported. `access.log` shows which URLs and addresses get the most requests. The viewer holds the last 1000 lines. The API call is `GET /v1/environments/{id}/logs/{file}`. See [View logs](https://docs.wpwaterfall.com/logs-viewer).

## Is PHP short of resources?

Open **Tools**, find the **PHP** card, and compare the memory and run time limits with what your plugins need. Change one setting at a time, then restart PHP from **Tools**. On **Info**, PHP performance shows the memory pool, the threads, and the memory per thread. Too few threads queue requests. Too little memory per thread fails them. If a recent PHP version change made the homepage return a server error, WP Waterfall switched back on its own and tells you why. See [Change PHP settings](https://docs.wpwaterfall.com/tools-php-settings).

## Is a cron job heavy?

Open **Cron**. A job that runs every 5 minutes and takes long, or whose last run shows a non-zero exit code, slows every request beside it. Open the row to see the exit code and the output. Pause the job from its switch or run it less often. See [Cron jobs](https://docs.wpwaterfall.com/cron-jobs).

## Is bot traffic the cause?

Open **Protection** to see the request counts of the last 24 hours. When bot protection is off, or on **Block malicious traffic**, automated traffic reaches PHP like any visitor. Move the level to **Block automations** or **Challenge bots**. Verified bots such as search engines pass at every level. For one address that floods `access.log`, add it under **IP Deny**. See [Bot protection](https://docs.wpwaterfall.com/bot-protection) and [IP deny](https://docs.wpwaterfall.com/ip-deny).

## Did a recent change start it?

Open **User Activity** to see who deployed, changed PHP, or cleared a cache, and when. **Deploys** on **Info** lists the releases. To undo a deploy, roll back to the earlier release on live's **Info** page. Rollback changes code only.

To test a plugin, clone content from live to staging, deactivate the plugin in wp-admin there, and compare.

## Still stuck

Message Nami from the chat button with the site name, the environment, one slow URL, the `x-wpwaterfall-cache` value for it, and the request ID or job ID.

## Related

- [Edge cache and CDN](https://docs.wpwaterfall.com/edge-cache)
- [Test your site's speed with Lighthouse](https://docs.wpwaterfall.com/lighthouse-speed-tests)
- [View logs](https://docs.wpwaterfall.com/logs-viewer)
- [Change PHP settings](https://docs.wpwaterfall.com/tools-php-settings)
- [Bot protection](https://docs.wpwaterfall.com/bot-protection)
- [IP deny](https://docs.wpwaterfall.com/ip-deny)
- [Cron jobs](https://docs.wpwaterfall.com/cron-jobs)
- [How Git deploys work](https://docs.wpwaterfall.com/code/git-workflow)
