I build my gzip-files with gulp (<strong>gulp-gzip</strong>) and use them with npm package <strong>connect-gzip-static</strong>:<pre class="snippet-code-js lang-js prettyprint-override">
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!Answer1:
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.