Craig Beamson
asked on
asp.net + Ajax axd page compression under IIS 6
I'm troubleshooting a few problems on our site and slow load time is one area I want to reduce.
Using Google's PageSpeed Insights, it reckons that some of the AJAX axd resource files associated with an autocomplete drop-down could be reduced by 933kb through compression.
Similarly, the .aspx page itself could be compressed for a further 85kb saving.
At first glance, IIS6 appears to be configured for compression (under the services tab for IIS > local computer > web sites > properties, "compress application files" and "compress static files" are ticked.
CSS and JS files weren't compressing until I used the info at http://www.jasonlinham.co. uk/2009/06 /turn-on-i is-6-compr ession-for -css-and.h tml
What can I do to apply compression to my .aspx and .axd files?
The environment is dot net framework 4.0, IIS 6 on Windows server 2003, using Ajax Control Toolkit (specifically, just the Autocomplete Extender)
Using Google's PageSpeed Insights, it reckons that some of the AJAX axd resource files associated with an autocomplete drop-down could be reduced by 933kb through compression.
Similarly, the .aspx page itself could be compressed for a further 85kb saving.
At first glance, IIS6 appears to be configured for compression (under the services tab for IIS > local computer > web sites > properties, "compress application files" and "compress static files" are ticked.
CSS and JS files weren't compressing until I used the info at http://www.jasonlinham.co.
What can I do to apply compression to my .aspx and .axd files?
The environment is dot net framework 4.0, IIS 6 on Windows server 2003, using Ajax Control Toolkit (specifically, just the Autocomplete Extender)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Ramkisan,
I've had mixed results from this package.
On the plus side - it does appear to do some minification.
On the downside - it causes some of my sites pages to throw exceptions (see below)
At first, I though this error was due to the fact that there was some code blocks in the head section of some pages on my site - used to set page titles, meta information and for setting redirect urls in client-side javascript. However, it seems hit and miss - on some pages where I have all these things, the page renders fine, on others it generates an exception. Having tried to temporarily remove the relevant code blocks to see if this fixe the problem, it does not.
Any ideas on what sort of thing is actually triggering these exceptions?
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
System.Web.UI.ControlColle ction.Remo veAt(Int32 index) +2109299
CombineAndMinify.HeadAdapt er.Process AllImages( ControlCol lection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMin ify\Code\C ombineAndM inify\Head Adapter.cs :145
CombineAndMinify.HeadAdapt er.Process AllImages( ControlCol lection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMin ify\Code\C ombineAndM inify\Head Adapter.cs :168
CombineAndMinify.HeadAdapt er.Process AllImages( ControlCol lection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMin ify\Code\C ombineAndM inify\Head Adapter.cs :168
CombineAndMinify.HeadAdapt er.Process AllImages( ControlCol lection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMin ify\Code\C ombineAndM inify\Head Adapter.cs :168
CombineAndMinify.HeadAdapt er.Process AllImages( ControlCol lection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMin ify\Code\C ombineAndM inify\Head Adapter.cs :168
CombineAndMinify.HeadAdapt er.Render( HtmlTextWr iter writer) in D:\@Projects\CombineAndMin ify\Code\C ombineAndM inify\Head Adapter.cs :92
System.Web.UI.Control.Rend erControlI nternal(Ht mlTextWrit er writer, ControlAdapter adapter) +8995547
System.Web.UI.Control.Rend erControl( HtmlTextWr iter writer, ControlAdapter adapter) +100
System.Web.UI.Control.Rend erControl( HtmlTextWr iter writer) +25
System.Web.UI.Control.Rend erChildren Internal(H tmlTextWri ter writer, ICollection children) +208
System.Web.UI.Control.Rend erChildren (HtmlTextW riter writer) +8
System.Web.UI.Page.Render( HtmlTextWr iter writer) +29
System.Web.UI.Control.Rend erControlI nternal(Ht mlTextWrit er writer, ControlAdapter adapter) +27
System.Web.UI.Control.Rend erControl( HtmlTextWr iter writer, ControlAdapter adapter) +100
System.Web.UI.Control.Rend erControl( HtmlTextWr iter writer) +25
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +3060
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
I've had mixed results from this package.
On the plus side - it does appear to do some minification.
On the downside - it causes some of my sites pages to throw exceptions (see below)
At first, I though this error was due to the fact that there was some code blocks in the head section of some pages on my site - used to set page titles, meta information and for setting redirect urls in client-side javascript. However, it seems hit and miss - on some pages where I have all these things, the page renders fine, on others it generates an exception. Having tried to temporarily remove the relevant code blocks to see if this fixe the problem, it does not.
Any ideas on what sort of thing is actually triggering these exceptions?
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
System.Web.UI.ControlColle
CombineAndMinify.HeadAdapt
CombineAndMinify.HeadAdapt
CombineAndMinify.HeadAdapt
CombineAndMinify.HeadAdapt
CombineAndMinify.HeadAdapt
CombineAndMinify.HeadAdapt
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Page.Render(
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Page.Process
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
ASKER
A further finding:
This exception only seems to occur when removeWhiteSpace is set to true.
Setting it to false prevents the exception but I'm still not sure what would be causing it.
This exception only seems to occur when removeWhiteSpace is set to true.
Setting it to false prevents the exception but I'm still not sure what would be causing it.
There's a script here you can run to add the file types to the metabase
http://lostechies.com/keithdahlby/2010/01/08/script-to-enable-http-compression-gzip-deflate-in-iis-6/
http://lostechies.com/keithdahlby/2010/01/08/script-to-enable-http-compression-gzip-deflate-in-iis-6/
ASKER
At face value, it looks like it answers a slightly different question to the one about (gzip-like) file compression. However, its very closely related and may well solve another related performance issue. I'll give it a try over the weekend.
Thanks.