Cassette bundles vs MVC4 bundles

六月ゝ 毕业季﹏ 提交于 2019-12-02 20:02:03

Information about ASP.NET MVC bundling is here: http://weblogs.asp.net/scottgu/archive/2011/11/27/new-bundling-and-minification-support-asp-net-4-5-series.aspx.

ASP.NET is adding a feature that makes it easy to “bundle” or “combine” multiple CSS and JavaScript files into fewer HTTP requests. This causes the browser to request a lot fewer files and in turn reduces the time it takes to fetch them.

The next release of ASP.NET is also adding a new feature that makes it easy to reduce or “minify” the download size of the content as well.

Looks like it's essentially the same thing as Cassette. All other things being equal, use the solution that is native to ASP.NET MVC.

I ended up using Cassette on my last project and it's working pretty well. There's really not a whole lot of configuration to it if you use NuGet, so my thinking is that it wouldn't be too hard to use Cassette now and then switch later if you wanted to.

One other thing to consider is that Cassette does Less compiling. I'm not sure if the MVC4 bundling does that or not since I haven't had time to read up on it.

Cassette is still an interesting alternative as it has native support for less and coffescript. It has also support for HTML Templates, if you are interested in client side mvc frameworks (backbone, knockout etc)

Just as an update to this, LESS and CoffeeScript support was added in the Update 2 package for Visual Studio 2012, so it's starting to look more and more like it would be better to add what transformations you need to the native implementation of the Bundling/Minification backed into MVC4 than go with Cassette in the long term.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!