What is bundling and minification, and is it still relevant?

ASP.NET MVC Performance Basic 1–2 Yrs2–3 Yrs Conceptual 1 min read

Quick Answer

Bundling combines many CSS/JS files into one to cut HTTP requests; minification strips whitespace and shortens names to reduce size. In classic MVC this was System.Web.Optimization; in ASP.NET Core it's WebOptimizer or, more commonly today, a real front-end build tool (Vite, webpack, esbuild) that also does tree-shaking and code-splitting.

Bundling merges your CSS and JS into fewer files so the browser makes fewer requests, and minification strips out whitespace and shortens variable names to make them smaller. Classic MVC had built-in optimization; ASP.NET Core uses WebOptimizer or, realistically, a front-end build tool like Vite or webpack that also does tree-shaking. HTTP/2 made the “fewer requests” part less critical, but minification and compression still count, and I always fingerprint the filenames or use asp-append-version so a deploy doesn't serve cached old assets.

  • HTTP/2 multiplexing reduced the “fewer requests” benefit, but minification and compression still matter, as do fewer large files vs many tiny ones.
  • Always add a cache-busting token (content hash in the filename or asp-append-version="true") so a deploy doesn't serve stale assets.
  • For a modern SPA-ish frontend, let the JS toolchain handle bundling and just serve the output.