Questions tagged [bundling-and-minification]

Bundling and minification are used to optimize web content by reducing the number of requests to the server and as well as the size of requested assets (such as CSS and JavaScript).

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

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.

References:

  1. Bundling and Minification
  2. Adding Bundling and Minification to ASP.NET Web Forms
  3. Adding Web Optimization to a Web Pages Site
  4. Performance Implications of Bundling and Minification on Web Browsing
1258 questions
0
votes
2 answers

Including unobtrusive-ajax making all scripts stop working

I having a issue while bundling by JavaScript files through Bundling in .NET MVC4 I am adding following scripts to bundle up in my code bundles.Add(new…
SajjadHashmi
  • 3,795
  • 2
  • 19
  • 22
0
votes
1 answer

.NET 4.5 System.Web.Optimization bundling use on CDN

I'm building a CDN, and looking for a ways to utilize .NET minification/bundling mechanism (System.Web.Optimization) there. The question is how can I return minified bundle from MVC controller. Note: I'm looking to use native .NET 4.5 capabilities,…
Sergej Popov
  • 2,933
  • 6
  • 36
  • 53
0
votes
1 answer

How to prevent same bundle from getting regenerated?

The problem we are running into is that we've defined two bundles containing .less files, and we'd like to use one bundle at one time, or the other, based on some arbitrary condition (Imagine that the bundles are nearly identical, but might have…
dplante
  • 2,445
  • 3
  • 21
  • 27
0
votes
1 answer

Scripts.Render() if not exists

I want the following call to render only if such call wasn't already declared in a parent view. @Scripts.Render("~/Scripts/jQuery") What's the best way to do so?
Alwyn
  • 8,079
  • 12
  • 59
  • 107
0
votes
1 answer

MVC4 bundling route exclusion

I make use of the bundling features in MVC4 by calling bundles.EnableDefaultBundles();, this allows me to browse to http://website.com/content/css which outputs a singular file of all the CSS files in the /content directory - great. The issue is I…
eth0
  • 4,977
  • 3
  • 34
  • 48
0
votes
1 answer

no request to minify javascripts

MVC4 C# web site, running in debug mode, the code in "BundleConfig" file is has: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/scripts").Include( …
Haddar Macdasi
  • 3,477
  • 8
  • 37
  • 59
0
votes
1 answer

Can Not Get Css to render with ASP.NET MVC4 ScriptBundling

I've got an app I started with ASP.NET MVC4 WebAPI project. somehow, my css is not getting rendered when I have BundleTable.EnableOptimizations Defaulted (which is true). When I set it to false (in my RegisterBundles.cs) file, the web site renders…
Peter Kellner
  • 14,748
  • 25
  • 102
  • 188
0
votes
1 answer

Mvc Bundling, Cache with Content or Cache with file name?

I'm deciding to remove all versions from static content that has been referenced in my Mvc Web Application. but I need caching. I want to know does the browser cache contents by file name or by content ? for example if I Bundle a Jquery version 1.6…
0
votes
0 answers

Bundling performance inside ASP.NET MVC

Is it better for performance to reference 4 js files on Microsoft CDN Example : JQuery, JQueryUI, JQuery Validation, Knockout.js or have it all in one Bundle ?
Radenko Zec
  • 7,659
  • 6
  • 35
  • 39
0
votes
1 answer

MVC Bundling & Minification with less isn't working with import

I'm trying to use Metro-bootstrap (http://talkslab.github.com/metro-bootstrap/) in VS 2012 with an MVC 4 project. I followed the steps in this post (http://stackoverflow.com/questions/9593254/mvc4-less-bundle-import-directory) but I'm still getting…
devlife
  • 15,275
  • 27
  • 77
  • 131
0
votes
1 answer

Looking for an advise on bundling of JS

I have an MVC 4.5 project that has most of the UI logic organized in jQuery plugins. I want to protect my code by minification and bundling (While I understand that minification will only do so much as far as protection, it's better than leaving…
user1044169
  • 2,686
  • 6
  • 35
  • 64
0
votes
2 answers

Bundling and Minification finding wrong file

So I'm having trouble all of a sudden where when I do my bundling and minification it pulls up the wrong file version. bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js")); bundles.Add(new…
0
votes
2 answers

MVC4 Internet Application template bundle enabled by default?

I am using Mvc 4 project from Internet Application template. Why bundle feature does not enabled by default or am I missing something? There is no such methods like this in Mvc4 as mentioned by other…
0
votes
3 answers

bundling script files in web application with asp.net optimization framework

I'm using following code to bundle my web application scripts, but it does not generate bundled script Bundle bundle = new Bundle("~/miniscripts/"); bundle.Include( "~"+ Paths.Scripts.AdminSkin.js.old_browsers_js, …
r.zarei
  • 1,261
  • 15
  • 35
0
votes
2 answers

Bundling and minification is sending old styles

I was followed this article to setup bundling and minification, http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification. I thought it was working great, until I updated some css, but I kept getting the old style. I am working in firefox, I…
Matthew
  • 1,148
  • 10
  • 17
1 2 3
83
84