Minifying JS and CSS is quite mon. The benefits of minifying JS are much greater that those seen with CSS because with CSS you can't rename elements - and same goes for HTML. But what if all 3 were minified together so that the benefits of using shorter names can be brought to CSS and HTML? That is, instead of minifying without any regard to the relationships between the 3, these could be preserved and made simpler. I imagine that the implementation could be quite difficult but if it were possible, do you think it would provide a significant advantage over traditional minification?
Minifying JS and CSS is quite mon. The benefits of minifying JS are much greater that those seen with CSS because with CSS you can't rename elements - and same goes for HTML. But what if all 3 were minified together so that the benefits of using shorter names can be brought to CSS and HTML? That is, instead of minifying without any regard to the relationships between the 3, these could be preserved and made simpler. I imagine that the implementation could be quite difficult but if it were possible, do you think it would provide a significant advantage over traditional minification?
Share Improve this question asked Dec 28, 2010 at 7:53 RaduRadu 8,6998 gold badges56 silver badges93 bronze badges5 Answers
Reset to default 6Probably not a significant benefit. If you gzip all your web content, then you will get the benefits of pression without the added plexity of all that minifying. And, you'll press all the content on your pages too, which is hopefully a significant portion of your page volume.
I imagine that the implementation could be quite difficult but if it were possible, do you think it would provide a significant advantage over traditional minification?
Minification does matter and this largely depends on amount of scattered pieces of text. Yahoo's YSlow and Google's Page Speed both do talk about all three and provide solutions such as saving the minified version from within themselves.
So it is good idea to minify where there is room for it and performance is critical.
Note that using GZIP solves many problems. gzipping responses is efficient if there is a lot of repeated text - for example your css classes. So instead of using a plex minification tool, use gzip.
Probably much less advantage than minifying JS, since you definitely can't change the CSS style attribute names. Most of the time, those take up the most space in CSS files. All you can do is shortening ID/class names and removing superfluous whitespace. I'd guess average savings of somewhere around 10% in the HTML/CSS part.
Also, what Greg said.
This will be of your interest
- http://lesscss/
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1741289397a4338749.html
评论列表(0条)