JavaScript Resource GZip Compression

This component library includes a JavaScript compression module that can be used to reduce the footprint of the main wwScriptLibrary.js library and any other script resource. To use this component you need to enable the Module in web.config:

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

This module basically enables compression of any script resources that normally would be loaded through WebResource.axd. Once hooked internal resource compression of the wwHoverPanel script library is automatic and no further changes are required.

To use this script compression with your own script resources you can use code like the following:

ClientScriptProxy.Current.RegisterClientScriptResource(this, typeof(ResourceLibTest.ControlResources), ResourceLibTest.ControlResources.JSON_SCRIPT_RESOURCE);

ClientScriptProxy detects whether the module is installed and if it is compresses script resources. ClientScriptProxy is also MS Ajax aware and so detects the presence of MS Ajax. If present it will delegate to MS Ajax resource compression (note though that MS Ajax Resource Compression requires an MS Ajax ScriptManager control on the page).


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