Class wwScriptCompressionModule

Module that handles compression of JavaScript resources using GZip and script optimization that strips comments and extra whitespace.

This module should be used in conjunction with ClientScriptProxy.RegisterClientScriptResource which sets up the proper URL formatting required for this module to handle requests. Format is:


The type parameter can be omitted if the resource lives in this assembly.

To configure the module in web.config (for pre-IIS7):

<system.web> <httpModules> <add name="wwScriptCompressionModule" type="Westwind.Web.Controls.wwScriptCompressionModule,Westwind.AjaxToolKit"/> </httpModules> </system.web>

For IIS 7 Integrated mode:

<system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <add name="wwScriptCompressionModule" type="Westwind.Web.Controls.wwScriptCompressionModule,Westwind.AjaxToolKit"/> </modules> </system.webServer>


public class wwScriptCompressionModule : object, IHttpModule

Class Members

wwScriptCompressionModuleActive Global flag that is set when the module is first loaded by ASP.NET and allows code to check whether the module is loaded.
public sealed void Dispose();
GZipMemory Takes a binary input buffer and GZip encodes the input
public static Byte[] GZipMemory( Byte[] Buffer );

public static Byte[] GZipMemory( string Input );

public sealed void Init( HttpApplication context );
OptimizeScript Very basic script optimization to reduce size: Remove any leading white space and any lines starting with //.
public static string OptimizeScript( string Script );


Namespace: Westwind.Web.Controls
Assembly: westwind.ajaxtoolkit.dll

  Last Updated: 7/8/2008 | © West Wind Technologies, 2008