this is de config file of nginx
gzip on;
gzip_disable "msie6";
# gzip_static on;
gzip_min_length 1400;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css image/png image/gif image/jpg application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript applicacion/x-font-ttf font/opentype application/x;
in the google analizer appears that the js files are not compressed, so i add to nodejs the gzippo module, this is the repo
//app.use(express.static(path.join(__dirname, 'public')));
app.use(gzippo.staticGzip(path.join(__dirname, 'public')));
when i add the module google says that js are gzipped, but in the repo doesnt say how can i add css files and images files to the gzippo module compression
so how can i know wich files are compressed with nginx or nodejs gzippo module, and how can i compress otf files???
Partial answer: to know whether some resource is being compressed, open up your browser's Developer tools, Network panel, and do a complete reload of your webpage (usually Shift + Reload button.) If a resource is being correctly served in a compressed state, you will notice the Size and Content values differ:
When using Firefox and Firebug, check the HTTP headers of a request. Click the Network tab and inspect a request. In the answer HTTP section, when a Content-Encoding gzip
then your request was successfully compressing.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.