Bundling


• What is Bundle?

            A bundle is a logical group of files that is loaded with a single HTTP request.Yoy can create style and script bundle for css and javascripts respectively, by calling BundleCollection class add() method with in BundleConfig.cs file.

• How bundling and minifying works in ASP.NET MVC

            In ASP.NET MVC4 web application you can find BundleConfig.cs file under App_Start folder.This file contains BundleConfig class that has only one method-RegisterBundles().In this method files that must be downloaded with one rquest are added to bundles.

• ScriptBundle and StyleBundle

            If you noticed then script bundle and style bundle have different classes.ScriptBundle is targeted to scripts and you shouldn't add any other files to script bundles Same with styles goes for StyleBundle.

         There are two minifying classes defined inSystem.Web.Optimizationsnamespace:

• JsMinify

• CssMinify