PageSpeed Insights(node.js)未检测到gzip压缩 [英] gzip compression is not detected by PageSpeed Insights (node.js)

查看:67
本文介绍了PageSpeed Insights(node.js)未检测到gzip压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用gulp( gulp-gzip )构建我的gzip文件,并与npm软件包 connect-gzip-static 一起使用:

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);

但是, PageSpeed Insights不会检测到gzip压缩。

However, PageSpeed Insights does not detect the gzip compression.

但是google chrome开发人员控制台说:响应标题:内容编码:gzip。其他的seo测试工具也正在检测gzip。
为什么Google没有?

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

我将所有html,js,css都压缩了。我也应该gzip svg吗?谢谢!

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

推荐答案

PageSpeed Insights应该告诉您哪些资源未压缩。

PageSpeed Insights should tell you which resources are not gzipped.

通常它们是您无法控制的第三方资源,或者可能是您尚未启用的类似SVG的类型。

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应该作为引导而不是福音。很容易挂在上面。尤其是如果您忽略了更大的原因,那么您的网站就很难在一种资源上节省一些字节。

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.

这篇关于PageSpeed Insights(node.js)未检测到gzip压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆