Saturday, 22 December 2018

What is Bundling and Minification

Bundling and minification are two techniques you can use in ASP.NET 4.5 to improve request load time. Bundling and minification improve load time by reducing the number of requests to the server and reducing the size of requested assets (such as CSS and JavaScript.)

Bundling is a feature in ASP.NET 4.5 that makes it easy to combine or bundle multiple files into a single file. You can create CSS, JavaScript, and other bundles as single file. Fewer files means fewer HTTP requests and that can improve first page load performance.

JavaScript minification is the process of reducing the size of the JavaScript file, by removing comments, extra white spaces, new line characters and using shorter variable names.

Advantages of JavaScript minification: As the minified JavaScript files are very small, they will be downloaded much faster and consumes less bandwidth. Search engines like Google consider page load time as one of the parameters to rank the pages.

The downside of JavaScript minification is these are harder to read and debug. However, for development and debugging we can use non-minified versions. Just before deployment, minify and use the minified versions on the production environment. 

No comments:

Post a Comment