Wednesday, December 5, 2018

What is the role of BundleConfig.cs in MVC

In a web application when we reference different files of JavaScripts and style-sheets, the browser sends individual requests to the server to fetch them. From ASP .NET 4.5 onward the developer will have the ability to create bundles of .js and .css files together so that the .js files are fetched in a single request from server. Bundling not only creates a single entity but also minifies all the content present in the bundles. This improves the performance of requests and requests are completed in a single go.

What Bundling Does

Clubs the files together to form a single file per bundle.

A bundle may contain many files, but a single request bring whole bundle irrespective of the number of files present in it.

JavaScript Bundles and Stylesheet bundles are different.

All the file content is minified in size by removing extra spaces, commented texts and shortening the names of scoped variables.

It becomes easy for developer to reference a set of files through single file thus making the code clean and more readable.

https://exceptionnotfound.net/asp-net-mvc-demystified-bundling-and-minification/

No comments:

Followers

Link