Wednesday, February 22, 2012

Bundling and Minification in ASP.NET 4.5 and MVC4

In MVC4 Beta release from Microsoft last week, have a look with series of blog and would like to talk about one feature called Bundling and Minification which is also available to ASP.NET 4.5

Bundling:
As per name suggest it bundle or combine multiple javascript, css requests to fewer Http request means bundle by type of file
Minifying: will remove white space form css and javascript which cause to reduce download size of that files

Let's if we have project with 3 javascript and 3 css files




Bundling and minifying the .css files
If you want to add css file as per listed above in fig then  you need to add refernce of all 3 files as per below which will result in to 3 separate http requests but this feature allow you to bundle and minify in to styles folder and call it in only one http request as per below.


Same way it will apply to javascript files as well
This is simple overview of this feature you can read about it in more details on scottgu's blog.

No comments: