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
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiztJzM5rClq3HfEjzxXn0cAIyWzsEN0KmYvOYSISl68pAMGxE4l8k79HkmHeCiGT0c2wsxTnRZ6zHg3s_H84EjRsVZcGQt7_yzAEbyz24qYfGlGT_WzvJGaahjwK1swIFfxTsGW0QR10rv/?imgmax=800)
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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizkRUY74IMEooRHCVGA_HOnbgY9TY0TB1QeAdhS2-nwFRz8QHBeRUKkK8zxynkKqSh8sWNhF9kq6A-JUcwJfv3cpgMSOnRf6JLn1ct73iGmWC9lN46RiRlQ0rdhYAtmv3fsz9SfNeOqoUO/?imgmax=800)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMjZl31eodv-8cSf0msXbBPe7yDwR0qLOPyjih7rtcC0Wun2yWs7hffqsZrpIe89O-AHJtlv0akfg4ck0jZV3wYCL4i6Nr1zB9-0ry1Pn_tkd4X4AzI25f3lmYoyQFdhJ8D4RN5RjUq1oj/?imgmax=800)
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.
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:
Post a Comment