简体   繁体   English

HTML CSS JS缩小架构

[英]HTML CSS JS minification architecture

I was exploring some sites for different minification techniques they are using. 我正在探索一些站点,以了解他们使用的不同缩小技术。

I had found most of sites does uses JS minification, concatenation and entire project had one js file which i feel is good technique. 我发现大多数站点确实使用JS缩小,串联,整个项目都有一个js文件,我认为这是一种很好的技术。

but css and html minification is still only upto removing extra spaces and comments. 但是CSS和HTML的缩小仍然只能消除多余的空格和注释。

But what i found that Google is using some different minification techniques in which they minify the css/html by changing the selector names in both HTML and CSS. 但是我发现Google使用了一些不同的缩小技术,通过更改HTML和CSS中选择器名称来缩小css / html

I would like to know about this minification architecture google is using. 我想知道Google使用的这种缩小架构。 :-) :-)

Advanced CSS minification 高级CSS缩小

I'm currently using CSSO minimizer with gulp and gulp-csso 我目前使用CSSO极小与一饮而尽 ,并一饮而尽,CSSO

CSSO (CSS Optimizer) is a CSS minimizer unlike others. CSSO(CSS优化器)是与众不同的CSS最小化器。 In addition to usual minification techniques it can perform structural optimization of CSS files, resulting in smaller file size compared to other minifiers. 除了常用的缩小技术外,它还可以执行CSS文件的结构优化,与其他缩小器相比,文件大小更小。

It works pretty well, the only thing is that you don't win that much on those optimizations. 它运行得很好,唯一的好处是您在这些优化上没有获得太多收益。

I would recommend to check out PageSpeed Tools , if you're not using it already. 如果您尚未使用PageSpeed Tools ,我建议您查看。 This is the best way to see, what kind of asset optimization you really need. 这是了解您真正需要哪种资产优化的最佳方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM