10

What's the best way to minify the ASP.NET generated Javascript, such as the ones served by webresource.axd, in ASP.NET 3.5 at runtime? I tried using the MbCompression module but it's not working with those resources.

craigmoliver
  • 6,499
  • 12
  • 49
  • 90

2 Answers2

11

If you want to minify the ASP.NET AJAX JavaScript, ensure that you've updated the compilation section of your web.config to turn off Debug mode:

<compilation debug="false">

This will ensure that the ScriptResource files are minified, however unless you've supplied minified versions of your JS files, these won't be touched.

Zhaph - Ben Duguid
  • 26,785
  • 5
  • 80
  • 117
  • Any references to this process? – felickz May 30 '13 at 14:15
  • Note that this will minify `ScriptResource.axd` only. For some reason, `WebResource.axd` doesn't get minified. – Doug S Nov 08 '15 at 08:25
  • Could you please look at this and help me. http://stackoverflow.com/questions/36198461/combining-multiple-calls-to-scriptresource-axd – bjan Mar 30 '16 at 10:24
0

Have you taken a look at the Ajax Minifier described in this blog post by ScottGu?

It might be just what you are looking for.

Quintin Robinson
  • 81,193
  • 14
  • 123
  • 132