Questions tagged [web-optimization]

The ASP.NET Web optimization framework provides services to improve the performance of your ASP.NET Web applications.

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. The easiest way to install the framework is via its NuGet package.

86 questions
69
votes
4 answers

CssRewriteUrlTransform with or without virtual directory

We are using MVC Bundling in our site, CssRewriteUrlTransform makes sure that the image urls work from the dynamic bundle css file. But this only works when not using a virtual directory, i.e http://localhost/VirttualDir does not work but…
Anders
  • 17,306
  • 10
  • 76
  • 144
65
votes
9 answers

How can I use 3-digit color codes rather than 6-digit color codes in CSS?

I recently went through my CSS file and switched all my six-digit hexadecimal codes to simple three-digit codes (for example, my #FDFEFF got shortened to #FFF). It renders pretty much the exact same color as before, and it seems to me that the…
animuson
  • 53,861
  • 28
  • 137
  • 147
29
votes
3 answers

CssRewriteUrlTransform is not being called

I just created a new MVC 5 app on VS 2013 RTM. For some reason background image url in my CSS files were not being transformed. So, to debug the issue, I created my custom CssRewriteUrlTransform wrapper. And I found that my breakpoint is not…
Moon
  • 33,439
  • 20
  • 81
  • 132
23
votes
1 answer

How does webopt:bundlereference work in ASP.Net?

In the default template of the ASP.Net web forms for Visual Studio 13, there is a tag webopt: After searching, it seems it is for bundling and minification. Is there any official…
10
votes
1 answer

Is there a way to update asp.net mvc bundle contents dynamically at run-time?

I'm ASP.NET MVC v4 for my application, and I'm using the web optimization features (bundling and minification of scripts and styles). Now, what I understand is (please correct me if wrong), the optimization framework will look at the included files…
9
votes
4 answers

Mixing Secure and Non-Secure Content on Web Pages - Is it a good idea?

I'm trying to come up with ways to speed up my secure web site. Because there are a lot of CSS images that need to be loaded, it can slow down the site since secure resources are not cached to disk by the browser and must be retrieved more often…
Dan Herbert
  • 99,428
  • 48
  • 189
  • 219
9
votes
1 answer

ASP.NET System.Web.Optimization: Bundling jQueryUI CSS

I am trying to bundle jQueryUI in one request. Global.asax: var cssjQuery = new StyleBundle("~/Content/BundleCSS/jQuery"); cssjQuery.IncludeDirectory("~/Content/themes/base", "*.css"); Layout:
Rookian
  • 19,841
  • 28
  • 110
  • 180
8
votes
1 answer

ASP.NET MVC4 how to create bundle with js and css together in one rule?

I have a superfish jquery plugin, which has 4 js and 1 css:
Edi Wang
  • 3,547
  • 6
  • 33
  • 51
7
votes
1 answer

Referencing other bundles in BundleConfig.cs in ASP.NET MVC4 app

I am working on an MVC4 application where I'm using WebOptimization to do all of my resource handling (cat and min). I have a few pages which are very similar, but need a few varying styles on a page by page basis. So, I am trying to reference one…
jasonmerino
  • 3,220
  • 1
  • 21
  • 38
7
votes
1 answer

ASP.NET MVC Bundle with absolute paths

I have virtual directory on IIS which contains all javascript and css files. Is it possible to include those files into ASP.NET MVC app using Bundles. I have already tried something like this: bundles.Add(new…
Danilo Vulović
  • 2,983
  • 20
  • 31
6
votes
2 answers

how do you add a "Cache-Control: public" header to a png file?

I've recently been looking at the Safari performance audits/recommendations. One section refers to adding Cache-Control: public header to some png resources. I've heard that said elsewhere and wondered how it can be done. In fact I'm not even sure…
T9b
  • 3,312
  • 5
  • 31
  • 50
6
votes
3 answers

Setting Far Future Expires Header In Code - ASP.NET

Is there a way that I can Programmatically set an Expires Header in code with ASP.NET? Specifically I need to set it on an entire folder and all sub-folders, and the folder contains only static files (JavaScript, CSS, Images etc.) and not aspx…
Sunday Ironfoot
  • 12,840
  • 15
  • 75
  • 91
6
votes
2 answers

What is the proper use of IItemTransform for correcting paths in CSS Bundling with ASP.NET Web Optimization and BundleTransformer?

I'm presently working on a project that uses the ASP.NET Web Optimization library (v 1.1.0-Beta1) in conjunction with the Bundle Transformer extension (v 1.7.3-Beta1 for core, 1.7.0-Beta1 for LESS) which is used to convert LESS into CSS. Based on…
6
votes
1 answer

Using bundles in WebForms outputs the minified/combined file even in debug mode

I've created a bundle of various script files that I want to be combined/minified together. In my code behind file (yes, sorry it's in VB!) I add it to a on the like this Me.PlhHeader.Controls.Add(New…
Chris Barr
  • 29,851
  • 23
  • 95
  • 135
6
votes
1 answer

ASP.NET bundling - default virtual paths?

As far as I can tell (because frankly documentation on System.Web.Optimization is very sparse), the way bundling works in ASP.NET is that you register a set of files (Javascript or CSS, corresponding with ScriptBundle and StyleBundle), and associate…
Jez
  • 27,951
  • 32
  • 136
  • 233
1
2 3 4 5 6