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:
wwScriptCompression.ashx?r=ResourceName&t=FullAssemblyName
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,wwHoverPanel"/> </httpModules> </system.web>
For IIS 7 Integrated mode:
<system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <add name="wwScriptCompressionModule" type="Westwind.Web.Controls.wwScriptCompressionModule,wwHoverPanel"/> </modules> </system.webServer>
public class ScriptCompressionModule : object, IHttpModule
Member | Description | |
---|---|---|
Constructor | ||
ScriptCompressionModuleActive | Global flag that is set when the module is first loaded by ASP.NET and allows code to check whether the module is loaded. | |
Dispose | 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 ); | |
Init | 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 ); |