Solved

asp.net + Ajax axd page compression under IIS 6

Posted on 2014-09-25
5
368 Views
Last Modified: 2014-10-02
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-iis-6-compression-for-css-and.html  

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)
0
Comment
Question by:Beamson
  • 3
5 Comments
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
ID: 40345396
Hi,

You can use the NuGet CombineandMinify package for that. it works for JavaScript files, CSS files and or images (loaded from image tags or from CSS files). If your pages use ASP.NET AJAX toolkit controls, they will be loading .axd files as well.

Please check the link below:
http://www.codeproject.com/Articles/125159/Package-that-speeds-up-loading-of-JavaScript-CSS-a

Hope this will help you!
0
 
LVL 1

Author Comment

by:Beamson
ID: 40345600
Hi Ramkisan,

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.
0
 
LVL 1

Author Comment

by:Beamson
ID: 40346763
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.ControlCollection.RemoveAt(Int32 index) +2109299
   CombineAndMinify.HeadAdapter.ProcessAllImages(ControlCollection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMinify\Code\CombineAndMinify\HeadAdapter.cs:145
   CombineAndMinify.HeadAdapter.ProcessAllImages(ControlCollection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMinify\Code\CombineAndMinify\HeadAdapter.cs:168
   CombineAndMinify.HeadAdapter.ProcessAllImages(ControlCollection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMinify\Code\CombineAndMinify\HeadAdapter.cs:168
   CombineAndMinify.HeadAdapter.ProcessAllImages(ControlCollection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMinify\Code\CombineAndMinify\HeadAdapter.cs:168
   CombineAndMinify.HeadAdapter.ProcessAllImages(ControlCollection cc, UrlProcessor urlProcessor, Boolean removeWhitespace) in D:\@Projects\CombineAndMinify\Code\CombineAndMinify\HeadAdapter.cs:168
   CombineAndMinify.HeadAdapter.Render(HtmlTextWriter writer) in D:\@Projects\CombineAndMinify\Code\CombineAndMinify\HeadAdapter.cs:92
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +8995547
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
0
 
LVL 1

Author Comment

by:Beamson
ID: 40346883
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.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40347668
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/
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now