Why bundle optimizations are no longer a concern in HTTP/2

The bundling optimization was introduced as a “best practice” when using HTTP/1.1 because browsers could only open a limited number of connections to a particular domain. A typical web page has 30+ resources to download in order to be rendered. With HTTP/1.1, a browser opens 6 connections to the server, request 6 resources in parallel, … Read more

How to force BundleCollection to flush cached script bundles in MVC4

We hear your pain on documentation, unfortunately this feature is still changing quite fast, and generating documentation has some lag, and can be outdated almost immediately. Rick’s blog post is up to date, and I’ve tried to answer questions here as well to spread current info in the meantime. We are currently in the process … Read more

MVC Bundling and CSS relative URLs

CssRewriteUrlTransform updates the CSS Url with absolute path, saying so if we use – bundles.Add(new StyleBundle(“~/Content/css”).Include(“~/Content/site.css”,new CssRewriteUrlTransform())); and we have following CSS class in “site.css” .Sandy { background-image: url(“Images/Sandy.jpg”); border: 1px solid #c8c8c8; border-radius:4px 4px 4px 4px; box-shadow: 1px 1px 8px gray; background-position:left; background-size:contain; -moz-background-size:contain; -webkit-background-size:contain; -o-background-size:contain; background-repeat:no-repeat; min-height:100px; min-width:100px; display:block; } and following folder … Read more

CssRewriteUrlTransform with or without virtual directory

I am not sure to fully understand your problem, but seeing http://localhost here seems wrong. You should never use an absolute URL for your bundles. For me CssRewriteUrlTransform works perfectly, here is how I use it: bundles.Add(new StyleBundle(“~/bundles/css”).Include( “~/Content/css/*.css”, new CssRewriteUrlTransform())); “Bundles” is virtual. Does this helps? Update I was confused with the “VirtualDir” thing, … Read more

Is using an ES6 import to load specific names faster than importing a namespace?

TL;DR: It does not matter. import * as … from ‘ramda’; import { … } from ‘ramda’; will both by default always bring in the complete Ramda module with all its dependencies. All code inside the module would be run, and which syntax was used to reference the exported bindings doesn’t matter. Whether you use … Read more

Bundler not including .min files

The solution I originally posted is questionable (is a dirty hack). The tweaked behaviour has changed in Microsoft.AspNet.Web.Optimization package and the tweak does not work anymore, as pointed out by many commenters. Right now I cannot reproduce the issue at all with the version 1.1.3 of the package. Please see sources of System.Web.Optimization.BundleCollection (you can … Read more