• Sign in
 
  •  
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...
Common Tasks
  • Blog Home
  • Email Blog Author
  • RSS for comments
  • RSS for posts
Search
Tags
  • .NET Framework
  • Ajax/Javascript
  • ARR
  • ASP.NET
  • CLR
  • Cool stuff
  • DataAccess
  • Debugging/Windbg
  • Hotfix/Service Pack
  • IDEVDataCollector
  • IIS
  • Internet Explorer
  • Italian techs
  • LogParser
  • OT
  • Personal
  • Productivity
  • Random
  • Scripting/ASP
  • Security
  • Technology
  • Tools
  • Troubleshooting
  • Vista/Longhorn
  • Visual Studio
Archives
Archives
  • January 2013 (2)
  • November 2010 (1)
  • October 2010 (1)
  • July 2010 (2)
  • April 2010 (1)
  • March 2010 (2)
  • February 2010 (2)
  • January 2010 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (1)
  • July 2009 (5)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (3)
  • March 2009 (3)
  • February 2009 (5)
  • January 2009 (3)
  • December 2008 (5)
  • November 2008 (3)
  • October 2008 (2)
  • September 2008 (3)
  • August 2008 (3)
  • July 2008 (3)
  • June 2008 (5)
  • May 2008 (4)
  • April 2008 (8)
  • March 2008 (4)
  • February 2008 (5)
  • January 2008 (2)
  • December 2007 (4)
  • November 2007 (6)
  • October 2007 (6)
  • September 2007 (8)
  • August 2007 (6)
  • July 2007 (7)
  • June 2007 (10)
  • May 2007 (9)
  • April 2007 (12)
  • March 2007 (8)
  • February 2007 (5)
  • January 2007 (3)
  • December 2006 (1)
  • November 2006 (4)
  • October 2006 (2)
  • September 2006 (9)
  • August 2006 (2)
  • July 2006 (1)

Ajax resource intermittently not accessible (http compression)

MSDN Blogs > Never doubt thy debugger > Ajax resource intermittently not accessible (http compression)

Ajax resource intermittently not accessible (http compression)

Carlo Cardella
21 Jan 2008 10:18 AM
  • Comments 6

A few days before Christmas I had a case where the customer was intermittently getting troubles with his javascript/Ajax resource; as usual everything was working fine on the development machine, but when moved on the production server the application started throwing some client side javascript exceptions like "myVar is undefined" which means that the Ajax resource was not accessible by the browser.

After some of the usual checks and discussions with the customer we found out that the production server was using HTTP Compression which is an old friend of mine (I already rambled about it here); they developed a custom HTTP Module to implement the .NET Framework compression classes and mechanism and disabling it was not an option, since their resource were quite large were affecting the applications' performance.

Then I had a couple of weeks off for Christmas and my colleague Gunnar took over the case (isn't nice when you go on holiday and someone else takes care of the job for you? smile_wink) and with some further debugging they found this interesting method:

private static bool IsCompressionEnabled(HttpContext context) { 
    return ScriptingScriptResourceHandlerSection.ApplicationSettings.EnableCompression && 
        ((context == null) || 
        !context.Request.Browser.IsBrowser("IE") || 
        (context.Request.Browser.MajorVersion > 6)); 
}

 

This means that Ajax does support compression for Internet Explorer 7 but it does not support compression for Internet Explorer 6. Why?

Well, the fact is that IE6 has some serious troubles with compressed content, and those issues have been resolved in IE7:

  • Internet Explorer may not decompress HTTP content when you visit a web site (scheduled for IE6 SP2)
  • Internet Explorer does not correctly decompress data that uses the GZIP data compression method (scheduled for IE6 SP2)
  • FIX: Internet Explorer 6 does not display the previous Web page when you browse an ASP.NET Web application and then click the Back button (scheduled for Windows XP SP3)

Another release containing several fixes is in the latest Windows Script 5.7 which contains updates for jscript parser:

  • You may experience slow performance when you view a Web page that uses JScript in Internet Explorer 6 (scheduled for WinXP SP3)

The problem for a public Internet side is that you don't know if advance if your users will have all those updated installed, and of course you cannot force them to update their systems; moreover there are some security updates released through Windows Update for IE6 have also updated the management for compressed resources. After some testing we found that customer's application was finally working with IE6 but HTTP compression was  not used by the runtime, so we decided to create an alias for IE7 (see clientTarget element) and then set Request.ClientTarget by code to one of those aliases to force the runtime consider the request as if it were coming from IE7 even if it was actually IE6; this enables both HTTP compression for Ajax resources and partial compressed postbacks.

 

Carlo

Quote of the day:
The wages of sin are death, but by the time taxes are taken out, it's just sort of a tired feeling. - Paula Poundstone
  • 6 Comments
ASP.NET, IIS, Ajax/Javascript, Internet Explorer
Leave a Comment
  • Please add 6 and 8 and type the answer here:
  • Post
Comments
  • WebLog of Ken Cox
    23 Jan 2008 1:46 PM

    One of my client's customers was really upset because Internet Explorer 6 would often hang on opening

  • Kevin
    20 Feb 2008 2:49 AM

    Is there a general solution to this problem?

  • Carlo Cardella
    20 Feb 2008 3:14 AM

    Well, if you're in a controlled environment (your company's Intranet) the easiest thing to do is likely upgrate to IE7, which does not have this problem. If yoou can't, and installing the fixes above does not help, then I think you shoud try to change your application to specify the appropriate ClientTarget (see the last paragraph in the post above).

    I'm not sure at the moment if and when will be released a fix for IE6, it depends on how hard and "dangerous" is to change that part of the browser...

    HTH

  • A developer's strayings
    28 Feb 2008 1:30 PM

    Again on the Ajax-compression subject (see here and here ), here's another error I got recently: Sys.WebForms.PageRequestManagerParserErrorException:

  • Never doubt thy debugger
    4 Dec 2008 10:29 AM

    Http compression with client-side scripting should be handled with care. The problem can have different

  • Kunal Kamboj
    14 May 2009 5:16 AM

    Hi I am getting a similar error but in my mo dule i am not using any kind of compression. I wanted to implement some kind of security in my module but still i am getting error on the pages having ajax controls. Is there any work around for this....

    Pleas Help

Page 1 of 1 (6 items)
  • © 2013 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy & Cookies
  • Report Abuse
  • 5.6.426.415