Questions tagged [asp.net-optimization]

Questions related to the ASP.NET Microsoft.AspNet.Web.Optimization nuGet package (System.Web.Optimization namespace), which supports bundling and minification of javascript and css files.

Project homepage: https://archive.codeplex.com/?p=aspnetoptimization

The Web optimization framework is installed via NuGet at https://nuget.org/packages/Microsoft.AspNet.Web.Optimization

Description:

The ASP.NET Web optimization framework provides services to improve the performance of your ASP.NET Web applications. Current services provided by the framework include:

bundling - combining multiple scripts or style resources together into a single resource, and thereby requiring browsers to make fewer HTTP requests

minification - making scripts or styles smaller using techniques such variable name shortening, white space elimination, etc.

Additionally, the framework has multiple extensibility points, enabling you to add new services over time.

174 questions
1
vote
3 answers

Blazor / ASP.NET Text Compression - Google speed test do not agree, why?

I have a blazor application where I added text compression, that way: context.Services.AddResponseCompression(o => { o.EnableForHttps = true; }); // We use Brotli by default :…
1
vote
1 answer

Add additional ordered bundles to a DynamicFolderBundle?

I have a DynamicFoldewrBundle : bundles.Add(new DynamicFolderBundle("userScripts", "*.js", true, new JsMinify())); So If I run : http://optimization.localtest.me/files/templates/designs/HelloTreble/userScripts ...It will render all Javascript…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
1
vote
1 answer

ASP.NET Minification removes javascript function name in some scenarios

Good Day, I am using default ASP.NET 4.5.1 bundling. All scripts are minified as expected apart of the following code: var events = [ function Create() { }, function Delete() { } ]; it was minified to var t =…
1
vote
1 answer

How to troubleshoot Angular JS Unknown Provider error in minified code

While the app works in debug mode, when release mode switches on .NET bundles, I get the Unknown Provider error. The problem is there many sources (Bootstrap UI and other third-party controls besides application scripts). I fixed a couple of obvious…
Mark Meyerovich
  • 193
  • 3
  • 9
1
vote
1 answer

Bundler renders styles merged and minified in Debug mode

Using VS 2013 Update 3 I am creating a new ASP MVC 5 app. Changing nothing, running this web app with F5, and monitoring the http trafic with fiddler I am seeing that one merged and minified CSS travelling. Debug mode if true in web.config. I would…
g.pickardou
  • 32,346
  • 36
  • 123
  • 268
1
vote
0 answers

ASP.NET web optimization framework

I am bundling and minifying my javascript files as shown below bundles.Add(new ScriptBundle("~/bundles/CommunityMaintenance") .Include( "~/Scripts/Common.js", "~/Scripts/AjaxEnhancers.js", …
Farax
  • 1,447
  • 3
  • 20
  • 37
1
vote
1 answer

Toolkitscript manager's scripts size too larg when donloaded to the client browser hence degrading sites performance

I am using ajax toolScriptManager since I've used update panel, calendar and mask extender. But when I observe the network instances the ToolScriptManager generates four javascripts files which are too large in size (355 KB) which really affecting…
Rhushikesh
  • 3,630
  • 8
  • 45
  • 82
1
vote
0 answers

System.Web.Optimization - Make Minified JS and CSS Cache Forever

I would like the output of bundles minified with the built-in JsMinify and CssMinify to have "cache forever" semantics so that browsers don't keep requesting them over and over. The resultant URLs are hashed based on the content so there's no sense…
blaster
  • 8,876
  • 11
  • 48
  • 77
1
vote
1 answer

Regarding js & css file bundle & minification

i never use this feature.so i am reading few article on it.some confusion created in my mind after reading a article on bundle & minification. so i would like to know & clear those confusion asking here. 1) i could understand what is bundle &…
Thomas
  • 33,544
  • 126
  • 357
  • 626
1
vote
1 answer

MVC4 bundle js minification error, is this a bug?

I tried to run the bundle of MVC4 on javascript files that contain the following function: $.fn.ApplyBehavior = function (behaviors) { var fns = behaviors.split(","); var $t = $(this); $.each(fns, function (i, o) { try { …
Ayyash
  • 4,257
  • 9
  • 39
  • 58
1
vote
2 answers

How do I include a ScriptBundle in a user control?

I have some legacy ASP.NET WebForms code that uses RegisterClientScriptInclude in a class that inherits from UserControl. I want to replace the multiple calls to RegisterClientScriptInclude with a single new-fangled Bundle. How do I resolve a…
Scott Stafford
  • 43,764
  • 28
  • 129
  • 177
1
vote
1 answer

Bundling css/js only in debug mode

Is there a way to make MVC4's bundling system include scripts/styles only in debug mode? For example, I have lots of debug mode scripts which help me debug my system. I obviously don't want them rendered when the system is in release mode. I thought…
1
vote
2 answers

MVC4 bundle {version} wildcard chokes on non-numeric versioning

As per MS bundling dev the {version} wildcard is a regex for (\d+(?:.\d+){1,3}). This differentiates between: jquery-1.8.2.js jquery-ui-1.9.0.js But because of non-numeric numbering (#.#.#pre) it chokes on: …
1
vote
3 answers

Microsoft.Ajax.Utilities.JScriptException from System.Web.Optimization

we are having issues deploying the latest System.Web.Optimization 1.0 library from NUGET. In our production instances on Azure, the logs fill up with Microsoft.Ajax.Utilities.JScriptException errors, CPU spikes to 100% and everything grinds to a…
viperguynaz
  • 12,044
  • 4
  • 30
  • 41
1
vote
1 answer

ASP.NET web forms BundleTable is still bundling in debug mode

I've got an ASP.NET web forms application, running on .NET 4.5 using the new Bundling and Minification features from the Microsoft.AspNet.Web.Optimization package. So far it's a very simple setup just with a single bundle. BundleConfig.cs public…