When a performance result shows a long wait before the document arrives, first establish which part of that wait belongs to the application. The browser may also be spending time resolving names, connecting, negotiating TLS or following redirects. A fast database query does not rule out a slow public request, and a slow public request does not prove the database is responsible.
Separate the request stages
Keep the tested URL, timestamp and response-time value from Sitepulse. Reproduce the request in the browser's Network panel and inspect the document timing. Confirm it is the expected page rather than a login screen, maintenance response or redirect to another host.
Newer Lighthouse reports group this investigation under document request latency. Preserve the distinction between the report's measured server wait and the wider navigation Time to First Byte. Sitepulse's separate response-time value covers its HTTP request, including receiving the response; it is not the document's TTFB. Compare like-for-like measurements instead of treating differently scoped durations as contradictory.
Trace one slow request through the origin
Use a request identifier to match the public observation with application, proxy and database timings. Look for repeated queries, lock waits, synchronous API calls and expensive template work. Measure the contribution before adding caches or increasing server capacity.
An illustrative timing record might look like this:
Request: GET /client-portal
Origin duration: 1,180 ms
Database work: 760 ms
Remote account lookup: 290 ms
Rendering and other work: 130 ms
In that case, investigate query count and the remote lookup first. Optimising a few bytes of HTML will not address the dominant delays. If the origin duration is low but the browser wait is high, inspect the network and intermediary path instead.
Apply the fix to the correct traffic
- For public, reusable content, consider an appropriate page or edge cache with deliberate expiry and invalidation.
- For personalised pages, optimise the underlying work and preserve isolation. Never cache one client's private response for another visitor.
- For an external dependency, use bounded timeouts and a recovery strategy appropriate to the operation.
- For work that need not finish before displaying the page, assess a background task rather than extending every request timeout.
Check cold, warm and busy behaviour
Verify the exact public URL after deployment. Compare a fresh request with a warm-cache request and check that both return the correct content. Where the defect depends on load, confirm the repair under representative traffic rather than repeatedly measuring an idle development server.
Record several comparable Sitepulse results and the supporting origin evidence. Improvement in one run is useful, but it does not establish that a recurring spike is fixed. Continue with redirect-chain diagnosis if navigation still includes unnecessary hops, or investigate gateway timeouts if the wait becomes a failure.