SquishIt 和 Combres2 之间哪一个具有更好的缩小效果?
有人比较过这两个库(Combres2 和 SquishIt)吗?如果一个库比另一个库更好,我也想知道其原因。
我发现文章说 Combres2 的压缩比 SquishIt 更好。但那已经是快一年前的事了。
Did anyone has the comparison between these two libraries (Combres2 and SquishIt)? If one library is better than another one, I also want to know the reason for that.
I found the article said that Combres2 has a better compression than SquishIt. But it is almost a year ago.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
需要注意的一件事是,SquishIt 的工作方式与 Combres2 不同,因此谁能生成更好的精简代码并不简单。
SquishIt 与 T4MVC 配合得非常好,而 Combres2 则无法做到这一点。仅凭这一点,我就会告诉任何人使用 SquishIt。此外,SquishIt 不是基于 xml 配置文件的,因此具有很大的灵活性。事实上,如果您确实需要的话,理论上您可以创建一个 xml 配置文件并模仿 Combres2。
在缩小方面,SquishIt 正在积极开发,这意味着如果创建缩小脚本的新方法,您也将更有可能利用它。目前它支持 JSMin、YUI、MS Ajax Minifier、Closure Minifier,甚至不支持 Minifier。
更新 1/18/2012:除了 SquishIt 和 Combres2 之外,现在还有许多其他替代方案。首先,Microsoft 正在为下一版本的 ASP.NET 4.5 创建自己的系统。 Cassette,类似于 SquishIt 和 RequestReduce,这与其他任何事情都非常不同,它会自动为您完成所有事情。
One thing to make note of is that SquishIt works in a different manner than Combres2, so it isn't a simple who produces better minified code.
SquishIt works very nicely with T4MVC, which you won't get with Combres2. On this basis alone I'd tell anyone to use SquishIt. Additionally, SquishIt is not xml config file based, which allows for a lot of flexibility. In fact, you could theoretically make an xml config file and mimic Combres2 if you really desired it.
In terms of minification SquishIt is actively developed, which means that if new methods to minify scripts are created you'll be more likely able to leverage that as well. Currently it supports JSMin, YUI, MS Ajax Minifier, Closure Minifier, or even no minifier.
Update 1/18/2012: There are now many other alternatives out there aside from SquishIt and Combres2. For starters, Microsoft is creating there own system for the next release of ASP.NET 4.5. Cassette, similar to SquishIt, and RequestReduce, which is quite different than anything else by automagically doing everything for you.
我是 SquishIt 的粉丝。即使 Combres 和 SquishIt 两者(可选)使用 YuiCompressor.NET 库(我对此有偏见;-))
作为 Justin Etheredge 的粉丝,我推荐/使用 SquishIt。
I'm a fan of SquishIt.. even though Combres and SquishIt both (optionally) use the YuiCompressor.NET library (which I am biased, for ;-) )
Being a fan of Justin Etheredge, I recommend/use SquishIt.
一个库比另一个库更好的原因(对我来说)是如果最终结果不是中断代码并且仍然有效。
我已经测试并使用了 Microsoft Ajax Minifier,我向您保证它工作绝对正确 - 甚至可以缩小 jQuery 库,没有任何问题。
http://ajaxmin.codeplex.com/
http://aspnet.codeplex.com/releases/view/40584
文档:
http://www.asp.net/ajaxlibrary/AjaxMinDocumentation.ashx
现在如果是一个库已经有一岁了,这无关紧要,因为他们只是在研究 javascript 代码,这些代码已经有一些标准了。
再次指出:更好的是产品最少的代码仍然可以在非常复杂的 javascript 函数(如 jQuery 所具有的函数)下工作。
需要注意的是:缩小的库可以一次缩小一整套文件,不要尝试一个一个地缩小并将它们添加到单个文件中,这是行不通的。
The reasons to one library is better than the other (for me) is if the final result is NOT a break code and still working.
I have test and working with the Microsoft Ajax Minifier, and I assure you that is working absolute correct - can even minifie the jQuery library with out any issue.
http://ajaxmin.codeplex.com/
http://aspnet.codeplex.com/releases/view/40584
documentaion:
http://www.asp.net/ajaxlibrary/AjaxMinDocumentation.ashx
Now if a library is one year old this have nothing to do, because they just working on javascript code that have some standards some years now.
To point again out : the better is the one that product minimum code that is still working under very complex javascript functions like the one jQuery have.
One note:a minified library can minified a full set of files at ones, do not try to minified one by one and them add them to a single file, this is not working.
这是对“Microsoft Ajax Minifier”建议的回应,也是对这样做的人的一般警告。由于我的声誉只有 41,所以我无法在该添加评论的位置添加评论。 :(
对于我们的团队来说,原生 C# VS2017 Microsoft 压缩(可能与标记为“Microsoft Ajax Minifier”的压缩相同,也可能不同)在 css 函数“calc”上失败了,而且很严重。
这有点棘手追踪,因为错误(显然)只发生在缩小过程中,而且由于我们是根据环境进行缩小的(与发布、调试交织在一起),这意味着计算错误(默认情况下)从未出现在本地。推送到生产环境...并且仅在使用 calc 函数的页面上
(绝对同意最小代码附加组件非常棒。但是本机压缩器可能会出现错误。因此请谨慎操作。)
如果您不使用“calc”。 (并且您没有注意到其他问题),那么您的团队可能可以使用默认的缩小工具,
当然,自从我们发现该错误以来,微软就可以修复该错误,但通过 msdn 报告错误并不总是能解决该问题。 :(
可能还有其他问题。但在我们的例子中(因为我们使用“calc”),这足以让我们研究其他压缩器,而 SquishIt 是我们团队的选择。那时我们还没有研究过 Compres2。到目前为止,我们对 SquishIt 非常满意。
旁注:由于 jQuery 3.6.0 和 VS2017 的 SquishIt 之间存在某种“冲突”,我正在再次研究缩小器。 (jQuery 3.4.1 和 SquishIt、VS2017 之间没有“冲突”)。问题解决过程的早期阶段。
最美好的祝愿和快乐的编码,
迈克尔·M。
This is meant as an answer to the 'Microsoft Ajax Minifier' recommendation, and a general warning for those that do so. As my reputation is a mere 41, I cannot add the comment there, where it should go. :(
For our team, the native C# VS2017 Microsoft compression (which may or may not be the same as the one labeled as 'Microsoft Ajax Minifier') failed on the css function 'calc', and badly.
That was a bit tricky to track down, since the error (obviously) only occurs during minification. And since we were minifying based on environment (interwoven with Release, Debug), that meant the calc bug (by default) never appeared on local. It just magically appeared when we pushed to production... and only on pages that used the calc function.
(Definitely agree that minimum code add-on is fantastic. But the native minifier can be faulty. So proceed with caution.)
If you are not using 'calc' (and you are noticing no other issues), then likely your team is fine with the default minification tool.
And of course, Microsoft could have fixed the bug since we discovered it. But bug reporting through msdn doesn't always lead to resolution of the issue. :(
There may be other issues. But in our case (since we use 'calc'), that was sufficient to have us investigate other minifiers, and SquishIt has been our team's choice. We had not looked at Compres2 at that time. Up until now, we've been very happy with SquishIt.
Side note: I'm in the middle of investigating minifiers again because of some sort of 'collision' between jQuery 3.6.0 and SquishIt for VS2017. (with no 'collision' between jQuery 3.4.1 and SquishIt, VS2017). Early stages of problem-solving process.
Best wishes and happy coding,
Michael M.