Minification and bundling in MVC 4

In MVC 4.0 or 4.5 , new feature came from microsoft  is Bundling and minification.

A)Bundling : Previously Files like multiple css and javascript , which were in queue for selecting single file, but in mvc 4 , multiple js or css files can be treat as single file request to browser ,

publicstaticvoidRegisterBundles(BundleCollection bundles){
    bundles.Add(newScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));// Code removed for clarity.BundleTable.EnableOptimizations=true;}

For page faster performing and loading it is very useful using the * caharcter multile files in a folder can be added .

B)Minification: Minification is an example of jquery min verion, but using any javascript file can be minified


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>