Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to compress ScriptResource.axd file, How can I compress it?

And I also want to defer parsing of this file.Is it posible? If yes, please provide solution for this.

Thanks All.
Posted

1 solution

I did this in my project recently.Please find the list of commands we used to turn compression on axd on.

1.In IIS Manager,Right-click on "Web Service Extensions" and add a new Web Service. Name it something like "HTTPCompression" and add the file "C:\WINDOWS\system32\inetsrv\gzip.dll". Check the "Set extension status to Allowed". Press "OK".

2.Then right-click on your server (local computer) and goto Properties. Check the "Enable Direct Metabase Edit". Press "OK".

3.Copy the below commands in BAT file and run the bat file.
@ECHO OFF
ECHO.

IF "%1"=="" GOTO ERROR1

ECHO BACKING UP THE METABASE FILE

IF EXIST C:\Inetpub\AdminScripts\adsutil.vbs (SET ADSFILE=C:\Inetpub\AdminScripts\adsutil.vbs)
IF EXIST D:\Inetpub\AdminScripts\adsutil.vbs (SET ADSFILE=D:\Inetpub\AdminScripts\adsutil.vbs)

ECHO ADS FILE LOCATION IS %ADSFILE%

IF "%ADSFILE%" == "" GOTO ERROR2

copy c:\winnt\system32\inetsrv\Metabase.xml %1

ECHO Adding settings for IIS6 HTTP Compression ECHO.
cscript %ADSFILE% set /w3svc/filters/compression/deflate/HcFileExtensions "css" "htc" "htm" "html" "txt" "js"
cscript %ADSFILE% set /w3svc/filters/compression/deflate/HcDynamicCompressionLevel "8"
cscript %ADSFILE% set /w3svc/filters/compression/deflate/HcOnDemandCompLevel "10"
cscript %ADSFILE% set /w3svc/filters/compression/deflate/HcScriptFileExtensions "asp" "exe" "aspx" "pser" "axd"
cscript %ADSFILE% set /w3svc/filters/compression/deflate/HcDoStaticCompression "FALSE"

cscript %ADSFILE% set /w3svc/filters/compression/gzip/HcFileExtensions "css" "htc" "htm" "html" "txt" "js"
cscript %ADSFILE% set /w3svc/filters/compression/gzip/HcDynamicCompressionLevel "8"
cscript %ADSFILE% set /w3svc/filters/compression/gzip/HcDoStaticCompression "TRUE"
cscript %ADSFILE% set /w3svc/filters/compression/gzip/HcOnDemandCompLevel "10"
cscript %ADSFILE% set /w3svc/filters/compression/gzip/HcScriptFileExtensions "asp" "exe" "aspx" "pser" "axd"


ECHO.
ECHO.
ECHO Changes completed. Do an iisreset for changes to have effect!
ECHO.
PAUSE
goto EXITERROR

:ERROR1
ECHO PLEASE PROVIDE BACKUP LOCATION.
goto EXITERROR

:ERROR2
ECHO ADSUTIL.VBS LOCATION IS NOT IDENTIFIED.PLEASE CONTACT CITI SME.

:EXITERROR


4. Restart the IIS
 
Share this answer
 
v2
Comments
hardiksince1987 1-Oct-12 14:19pm    
Thankyou for the solution, I have removed <ScriptManager> from my application, Now it has only Webresource.axd. I will use you solution compress this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900