Reputation: 164
I generate my css file using Sass/Compass (scss style) with the "compressed" outputstyle:
compass watch --output-style compressed
This way it is minified and without comments, etc. However, Google Pagespeed Insights still tells me that I can win size with minifying.
Probably I could win some space, but since it's a generated file, I do not want to keep manually minifying it.
Is the Compass outputstyle known to not be efficient? Is there something else I need to look at, that can be done dynamically with the generated css file?
Upvotes: 0
Views: 509
Reputation: 21
I am in the middle of optimising some of my sites, and the only way I can get PageSpeed to give me 100% is to inline the CSS and compress it (using Gulp) during output to my distribution folder. This is along with automatice GZip of files on the server, and compression of both HTML and inline CSS. Also have to defer loading of JavaScript and keep some of that inline (particularly for mobile).
Upvotes: 1
Reputation: 145
It matters for the first bite load, then it will get cached anyways, however you can still optimize your Css by removing unnecessary code, what i mean here is code that will never been used in your page. Another optimization technique is to reduce nesting levels because nesting inflate the .css file size
Upvotes: 1
Reputation: 6387
You could install mod_pagespeed or use PageSpeed Service. Both are automated tools for optimizing websites based on PageSpeed rules.
Upvotes: 0