开发中,EXT封装的.NET控件,使用了ExtJsExtenderControl的开源控件,发现个问题,就是每次控件加载,都需要调EXT_ALL.JS文件,600K,导致页面加载很慢。想对这个问题进行优化,查了下网上的反馈,基本上都主张对JS进行GZIP压缩.但控件中的EXT_ALL.JS是动态加载的,不知道如何压缩和解压实现,请大家给点意见谢谢,
ExtJsExtenderControl控件中,OnPreRender中加载JS文件的代码:
base.ClientScriptProxy.RegisterClientScriptResource(this, typeof(ExtAll), "ext-all.js");
加载控件后,调用资源文件的代码如下:
 if (RegisterClientScriptResourceMethod == null)
                {
                    RegisterClientScriptResourceMethod = scriptManagerType.GetMethod("RegisterClientScriptResource", new Type[] { typeof(Control), typeof(Type), typeof(string) });
                }
                RegisterClientScriptResourceMethod.Invoke(null, new object[] { control, type, resourceName });

希望在这两个函数中,针对ext-all.js压缩和解压缩。希望大家给点意见,谢谢。
ExtJsExtenderControl控件的下载地址是:
http://extjsextendercontrol.codeplex.com/