---
title: "Define Bundling and Minification in MVC."  
description: "Define Bundling and Minification in MVC."  
author: "Anonymous User"  
published: 2020-02-15  
updated: 2020-02-15  
canonical: https://www.mindstick.com/forum/155822/define-bundling-and-minification-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 3 minutes  

---

# Define Bundling and Minification in MVC.

Please [briefly explain](https://www.mindstick.com/forum/156854/briefly-explain-the-concept-of-constructor-overloading) about [bundling and minification](https://www.mindstick.com/forum/12842/how-to-transform-styles-urls-to-cdn-urls-in-asp-dot-net-bundling-and-minification) with a suitable example and with a figure.

## Replies

### Reply by Shrikant Mishra

Here bundling and minification are two techniques enabled by ASP.NET, an open-source tool for building services and web apps using. NET. ASP.NET Bundling is a simple feature that makes it easier to combine multiple files into one, while minification is a process whereby code in a script or CSS file is optimized.

### Reply by Nishi Tiwari

The bundling and [minification](https://www.mindstick.com/forum/159933/what-is-bundling-and-minification-in-asp-dot-net-mvc-and-why-is-it-important) are the two separate techniques that are used to reduce the load time. This bundling reduces the number of requests to the Server, whereas minification reduces the size of the requested assets.

Mainly the browsers process six requests simultaneously to each Website that is why all additional requests are queued by the Browsers and if we reduce these requests, the queued time for the other requests will be decreased as well. Therefore, bundling is used to reduce these requests from the Browser to Server.

The minification is the process of removing all unnecessary characters from a text-based resource like JS and CSS in a way that doesn’t alter the expected functionality. It means shortening identifiers, aliasing functions and removing the comments, white-space characters, and newlines.

The bundling and minification technique in ASP.NET MVC offers by **System.Web.Optimization** class, which exists under the **System.Web.Optimization dll.**

## Bundling

The bundling is a logical group of physical files, which loads on to a single HTTP request. If we have separate CSS files, then it can be loaded in a single request with the help of bundling. This bundling is also creating JavaScript files separately. A bundle can’t contain both the **[CSS and JavaScript files](https://www.mindstick.com/forum/155821/how-we-will-generate-textarea-control-using-htmlhelper-in-razor-view)** for this we need to create a separate bundle for CSS and JavaScript files and we have to create a bundle, based on the use of CSS or JS files in an application. For example, if an application uses both the bootstrap and site CSS for UI design, due to that we can create a common bundle for them, such as a core bundle. The given figure shows a logical grouping of a file to create a bundle.

![Define Bundling and Minification in MVC.](https://www.mindstick.com/mindstickforums/0dd30381-acdd-4947-a3bf-523cadc18be2/images/eba9fae4-0b5c-4280-b529-26dbef8990c6.png)

## Minification

The Minification can be describe as a technique for removing unnecessary characters like white space, newline, tab, comments and short variable names from the text-based files such as JavaScript and CSS files without expecting alter functionality to reduce the size, which causes to improve load times of a Webpage and also there are some tools which are available to minify JS and CSS files.


---

Original Source: https://www.mindstick.com/forum/155822/define-bundling-and-minification-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
