Cut your server response time
Get time-to-first-byte under 500ms with caching and a CDN.
30–60 min
why this matters
Server time is pure dead time: nothing renders until the first byte arrives, so it delays every other metric on the page.
Step by step
- 1
Put a CDN in front of the origin
Cloudflare, Fastly or your host's built-in CDN serves cached pages and assets from a location near each visitor. This alone usually halves response time for far-away users.
- 2
Cache full pages where you can
For pages that don't change per visitor, set an explicit cache header so the CDN can serve them without touching your server.
Cache-Control: public, max-age=60, stale-while-revalidate=600 - 3
Find the slow query
Enable slow query logging in your database and add indexes for the columns your slowest queries filter and sort on. One missing index is the usual culprit.
- 4
Add object caching
Cache expensive computed values and API responses in Redis or your framework's cache layer instead of recomputing them on every request.
how to check it worked
- TTFB under 500ms from a region far from your server
- Repeat requests report a CDN cache hit
related guides
Fix a site that isn't responding
None of the four common addresses for your domain returned a working page. Work through DNS, then the server, then the firewall.
Put your site on HTTPS
Install a free TLS certificate and serve every page over HTTPS.
Redirect HTTP traffic to HTTPS
Send every insecure request to the secure version with a permanent 301 redirect.
Pick one canonical hostname
Serve your site from a single address and redirect all the others to it.