We can do bundling and minification to improve request load time.
Minification performs a variety of different code optimizations to scripts or css, such as removing unnecessary white space and comments and shortening variable names to one character
To enable bundling and minification, set the debug value to “false”. You can override the Web.config setting with the EnableOptimizations property on the BundleTable class. The following code enables bundling and minification and overrides any setting in the Web.config file.
In MVC we can create bundle in bundleconfig files as shown in code.
public class BundleConfig
public static void RegisterBundles(BundleCollection bundles)
Bundle Cssbundle = new Bundle("~/CssBundle", new CssMinify());
BundleTable.EnableOptimizations = true;
similarly we can use JS bundle as well.
and on the view page or shared view we can directly called with bundle name.
Hope this help you in minification and bundling.