There are quite a few settings one can tweak at the distribution layer to make the websites load faster. More often than not, the returns from these tweaks are close to zero if not outright negative.
Things like adjusting TCP buffers, tuning sysctl.conf, changing keepalive timeouts seem like good ideas in theory. But the average “enterprise” WordPress site these days has so many components between the server and the visitors that adjusting any settings on the server has close to no impact on scalability.
Components like WAFs, CDNs, Edge workers, and NAT Gateways intercept end-user connections, and the server only sees a small amount of traffic that is usually best served with default network parameters.
So what can you tweak on your network that has the biggest impact on site performance?
The answer is to enable HTTP/2.
HTTP/2 can send multiple requests for data in parallel over a single TCP connection. For WordPress sites, this means that the browser can download most css and js files without opening new connections for each file.
Most web servers and edge components use HTTP/1.1 by default, which supports 6 concurrent connections. This means that the browser can only download 6 files at a time. The average website these days needs a lot more than 6 elements to work. Thus we are taught to minify and merge css and js files.
When you use HTTP/2, you don’t need to worry about combining css and js files. Because HTTP/2 can deliver multiple files in the same TCP connection, browsers can download more site assets in the same amount of time or less.
On the server-side, this means you can serve more visitors with the same amount of connections, and they move along faster. Everpot.com has a nice interactive demonstration of the performance difference between HTTP/1.1 and HTTP/2.
To enable HTTP/2 for your visitors, check with your firewall, CDN, proxy provider. While you are at it, also consider enabling HSTS and TLS 1.3. When combined, these settings result in a noticeable performance boost on modern browsers.
If you run a very high traffic site, you can go one step further and enable HTTP/2 between the CDN and your server for an additional performance boost.
To enable HTTP/2 on nginx, add the keyword http2 in your ssl config like this:
listen 443 ssl http2;
One thing to keep in mind is that HTTP/2 requires TLS. If you are configuring your CDN to use HTTP/2 for the backend connections as well, make sure that the webserver has an SSL certificate installed and adjust the host headers on the CDN as needed.