gzip compression is not detected by PageSpeed Insights (node.js)

陌路散爱 提交于 2020-01-07 07:43:48

问题


I build my gzip-files with gulp (gulp-gzip) and use them with npm package connect-gzip-static:

var app = express();
var serveStatic = require('connect-gzip-static');

//...

app.use(serveStatic(__dirname)).listen(3000);

However, PageSpeed Insights does not detect the gzip compression.

But google chrome developer console it says: Response Headers: Content-Encoding: gzip. Also other seo testing tools are detecting gzip. Why Google doesen't ?

I gziped all html, js, css. Should I also gzip svg's ? Thanks!


回答1:


PageSpeed Insights should tell you which resources are not gzipped.

Often they are third party resources out of your control, or it may be types like SVG that you have not enabled yet.

PageSpeed Insights should be taken as a guide and not gospel. It's easy to become hung up on it. Especially if you ignore the bigger reasons your site is slow to save a few bytes on one resource.



来源:https://stackoverflow.com/questions/37758003/gzip-compression-is-not-detected-by-pagespeed-insights-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!