views:

483

answers:

5

How do you compress Script Resources of ASP.Net? I saw a file there reached up to 255 KB! I tried finding solutions, but so far it only talks about scripting dynamic and static files. I checked the compression temp folder of IIS and found no compressed scripted resource there. That led me to the conclusion that these files are transferred over with high bandwidth.

+1  A: 

If you're running IIS6 the guys at OrcsWeb have a nice wee article -

http://weblogs.asp.net/owscott/archive/2004/01/12/57916.aspx

We have customers running the port80 software because they get more control:

http://www.port80software.com/products/zipenable/ http://www.port80software.com/products/httpzip/

HTH
Kev

Kev
A: 

Check out the JSCompress task in the MSBuild Community Tasks (http://msbuildtasks.tigris.org/). It'll strip out the whitespace from a JS file for you.

Slace
+1  A: 

I don't know about tying something into ASP.net but there are a number of standalone compressors. Packer is available as a .Net app. JSMin is available in a number of languages but none of them .Net, and there's ShrinkSafe which requires java. It should be pretty simple to tie any of them into your build process.

slashnick
+1  A: 

the best would be to implement an httpHandler in the web.Config.

see http://blog.madskristensen.dk/post/Optimize-WebResourceaxd-and-ScriptResourceaxd.aspx

jono
A: 

Thank you :)

Hanz