Website performance is not just a user experience concern — it directly affects SEO rankings, conversion rates, and revenue. Google's Core Web Vitals are now a confirmed ranking signal. A 100ms improvement in TTFB can meaningfully increase conversion rates for e-commerce sites. Here is how to audit and improve each dimension of web performance.
DNS Lookup Time
Before any HTTP connection can be established, the browser must resolve your domain name to an IP address. This DNS lookup adds latency on every new connection from a user who has not recently visited your site.
Measure it:
curl -w "DNS: %{time_namelookup}s
" -o /dev/null -s https://yoursite.com
Optimize:
- Use a fast DNS provider — Cloudflare (1.1.1.1 infrastructure), AWS Route 53, and Google Cloud DNS all offer sub-10ms resolution globally
- Set a reasonable TTL — 300 seconds (5 minutes) balances cache hits with propagation speed
- Use DNS prefetching for third-party domains your page loads:
<link rel="dns-prefetch" href="//fonts.googleapis.com">
Target: Under 50ms from major geographic regions.
Time to First Byte (TTFB)
TTFB measures the time from when the browser sends a request to when it receives the first byte of the response. It encompasses DNS resolution, TCP connection, TLS handshake, and server processing time. Google's Core Web Vitals recommend TTFB under 800ms for a "good" rating.
Measure it:
curl -w "TTFB: %{time_starttransfer}s
" -o /dev/null -s https://yoursite.com
Common causes of high TTFB:
- Slow database queries (N+1 queries, missing indexes)
- No caching on expensive computed responses
- Server geographically far from the user
- Missing CDN for edge caching
- TLS handshake overhead (mitigated by TLS 1.3, 0-RTT, session resumption)
Target: Under 200ms for cached pages, under 500ms for dynamic pages.
Page Size and Compression
Uncompressed HTML, CSS, and JavaScript files transfer slowly on mobile connections and increase parsing time. Enable Brotli or gzip compression on your server — it typically reduces text-based responses by 60-80%.
# Check if a response is compressed:
curl -sI https://yoursite.com -H "Accept-Encoding: br, gzip" | grep -i "content-encoding"
# Should show: content-encoding: br (or gzip)
Additional page size optimizations:
- Minify CSS, JavaScript, and HTML — removes whitespace and comments
- Use modern image formats: WebP (30% smaller than JPEG), AVIF (50% smaller)
- Lazy-load images below the fold with
loading="lazy" - Remove unused CSS — tools like PurgeCSS can cut stylesheet size by 90% for utility-framework-heavy pages
Target: Under 500KB total page weight for the initial view.
HTTP Caching Headers
Proper cache headers allow browsers and CDNs to serve resources without hitting your server at all. This eliminates round-trip time entirely for returning visitors and Cloudflare edge nodes.
# Static assets (CSS, JS, images) — cache for 1 year, immutable
Cache-Control: public, max-age=31536000, immutable
# Dynamic pages — must revalidate
Cache-Control: no-cache, must-revalidate
# API responses — short cache or no-store
Cache-Control: no-store
The immutable directive tells browsers not to revalidate the file on navigation — only use it when you use content-addressed filenames (e.g., main.abc123.js).
HTTP/2 and HTTP/3
HTTP/1.1 processes one request per connection (browsers work around this by opening 6 concurrent connections). HTTP/2 supports multiplexing — multiple requests over a single connection with header compression. HTTP/3 (QUIC) further reduces latency on unreliable connections (mobile).
Check HTTP version:
curl -sI --http2 https://yoursite.com | head -1
# Should show: HTTP/2 200
Most modern reverse proxies (Nginx 1.9.5+, Caddy, Cloudflare) support HTTP/2 by default when TLS is enabled. HTTP/3 requires explicit enablement.
Connection Optimization
TLS handshakes add 1-2 round trips to every new connection. Several techniques reduce this:
- TLS 1.3: Reduces handshake to 1 round trip (vs 2 for TLS 1.2)
- 0-RTT resumption: Zero additional round trips for returning connections (with a replay-attack caveat)
- Preconnect hints:
<link rel="preconnect" href="https://api.yoursite.com"> - Keep-Alive: Reuse TCP connections across multiple requests (enabled by default in HTTP/2)
Core Web Vitals Summary
- LCP (Largest Contentful Paint): Time until the largest visible element renders. Target: under 2.5s. Fix: optimize your hero image or H1, reduce TTFB, use a CDN.
- FID/INP (Interaction to Next Paint): Responsiveness to user interaction. Target: under 200ms. Fix: split long JavaScript tasks, defer non-critical scripts.
- CLS (Cumulative Layout Shift): Visual stability — how much elements shift after rendering. Target: under 0.1. Fix: set explicit width/height on images and embeds.
Use Shieldome's performance module to get a baseline measurement of DNS time, TTFB, page size, compression status, and HTTP version in a single automated scan.