I have a website with all of the pages served from nginx’s http cache and rarely invalidated or expired.
The average total page download size is around 2 MB But despite being a static site with no funny logic my server response is around a second
I recorded nginx’s $request_time
and it comes to around 400 milliseconds from the server
and each file at 20-30 KB average
400 millisecond seems to be absurd.
I am behind Cloudflare and
sendfile on;
tcp_nopush off;
tcp_nodelay on;
keepalive_timeout 300s;
keepalive_requests 10000;
What should I be doing to bring down the response time to the 150-millisecond range?
Edit: First part of my tunning.
Realized I didn’t have SSL OSCP on. Tweaked code to
# https://github.com/autopilotpattern/wordpress/issues/19
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 1d;
ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/site.com/chain.pem;
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
I’ll report back on improvement.
Edit 2:
Here’s the webpage test result for 3G connection hit from India to a US west coast server