Answer the question
In order to leave comments, you need to log in
Why doesn't gzip speed up site loading time?
I read about the loading time of site pages and almost everywhere it is written that you can also use gzip to speed up the download. I took a simple nginx configuration as tests:
user nginx;
worker_processes 4;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
access_log /var/log/nginx/access.log;
server {
listen 80;
server_name localhost;
gzip on;
gzip_types text/html text/plain image/png image/jpeg text/css text/xml text/javascript application/x-javascript application/xml;
location / {
root /data/www;
}
}
}
Answer the question
In order to leave comments, you need to log in
Question - why didn't the page load time speed up?
http {
....
gzip on;
gzip_http_version 1.0;
gzip_min_length 512;
gzip_buffers 64 8k;
gzip_comp_level 5;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
...
}
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 24 Nov 2017 11:32:00 GMT
Content-Type: text/html
Last-Modified: Tue, 12 Apr 2016 06:48:17 GMT
Connection: keep-alive
ETag: W/"570c9a31-576"
Content-Encoding: gzip
Judging by the Network panel, an uncompressed file was transferred - 0.99 Mb.
For example, this page includes the file
https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic&subset=latin,cyrillic
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question