Server configuration

The server drives TTFB, the first component of LCP. Here are the high-impact settings.

Updated

Compression

Brotli first, gzip as fallback, on text resources only (not images or WOFF2).

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>
# Brotli (mod_brotli)
<IfModule mod_brotli.c>
  AddOutputFilterByType BROTLI_COMPRESS text/html text/css text/javascript application/json
</IfModule>

HTTP/2 and HTTP/3

Multiplexing and header compression; HTTP/3 (QUIC) is widely deployed across CDNs and browsers (Can I use). HTTP/2 “server push” is deprecated: use Preload or 103 Early Hints.

Redirects

Every hop adds latency. Permanent redirect:

Redirect 301 /old-page.html /new-page.html

Other levers

  • Server cache and PHP-FPM with OPcache for dynamic sites (Caching).
  • Minify HTML, CSS and JS in your build.
  • Right-sized hosting close to your audience, with a CDN.