Tuesday 3 January 2012

ASP.NET MVC 4: Bundling & Minification

Any website or web-application is basically built on 2 facets.. server-side programming and Client-side programming. As the Client-side programming/operations increase, the programmers need to make user of more and more JavaScripts to make it more attractive. And as the use of JavaScripts increase, the browsers start responding with typically low response times. To overcome this, we need to combine all JavaScripts files in one. But as far as code maintainability is concerned, this is not the right move. Another way is to combine and minify all the JavaScript files on the program. This is the best possible solution.

With .NET 4.5 and MVC 4, Microsoft has introduced a new feature called Bundling and Minification which bundles the multiple JavaScript and CSS files in one requests and minify their combine effect  by removing white spaces and characters, which are not required. Microsoft introduced a new class called BundleTable which takes care of Bundling and Minification.

The BundleTable class is shipped with two inbuilt Bundles for JavaScript and CSS respectively. However, the ASP.NET programmers can easily create their own custom Bundle as per the requirement. Thus, with .NET 4.5, it is easier to implement Bundling and Minification with very less effort and without major changes. Hope this will be helpful.

At SPEC INDIA, our trained team of ASP.NET developers is eager to take care of any custom requirement from our probable Clients and prospects from all over the globe. If you have any requirement or queries, feel free to drop an email at our id lead@spec-india.com, we will be happy to assist you.


No comments:

Post a Comment