blog.pekhov.com
September 2026 nginxweb

Tuning Static Asset Headers and HTTP/2 in Nginx

Even a tiny static site benefits from clean TLS 1.3 defaults, HTTP/2 multiplexing, and sensible cache lifetimes for stylesheets and icons.

location ~* \.(css|svg|png|woff2)$ {
    expires 7d;
    add_header Cache-Control "public, immutable";
}

Keeping static pages free of third-party scripts also ensures predictable load times across slow mobile links.

← Back to all notes