Bundling in visual studio 2012 for web optimization

Posted by Jalpesh P. Vadgama on ASP.net Weblogs See other posts from ASP.net Weblogs or by Jalpesh P. Vadgama
Published on Wed, 27 Jun 2012 15:35:21 GMT Indexed on 2012/06/27 21:18 UTC
Read the original article Hit count: 274

I have been writing a series of posts about Visual Studio 2012 features. This series describes what are the new features in the Visual Studio 2012. This post will also be part of Visual Studio 2012 feature series.

As we know now days web applications or site are providing more and more features and due to that we have include lots of JavaScript and CSS files in our web application.So once we load site then we will have all the JavaScript  js files and CSS files loaded in the browsers and If you have lots of JavaScript files then its consumes lots of time when browser request them.

Following images show the same situation over there.

Bundling feature in Visual Studio 2012 - Visual Studio 2012 feature series 

Here you can see total 25 files loaded into the system and it's almost more than 1MB of total size. As we need to have our web application of site very responsive and need to have high performance application/site, this will be a performance bottleneck to our site. In situation like this, the bundling feature of Visual Studio 2012 and ASP.NET 4.5 comes very handy. With the help of this feature we do optimization there and we can increase performance of our application.

To enable this feature in Visual Studio 2012 we just made debug=”false” in web.config of our application like following.

How to enable bundling in Visual Studio 2012

Now once you enable this feature and run this application in the browser to see your traffic it will have less items like following.

AfterBudnlingenabledinVisualStudio2012

As you can see in the above image there are only 8 items. So after enabling bundling it will automatically convert all js and css files into the one request. Isn’t that cool feature? This feature will surely going to have great impact on performance. Hope you like it. Stay tuned for more.. Till then happy programming!!

Shout it

© ASP.net Weblogs or respective owner

Related posts about ASP.NET

Related posts about VisualStudio