Welcome to MSDN Blogs Sign in | Join | Help

Bugs in IE8's Lookahead Downloader

Internet Explorer has a number of features designed to render pages more quickly. One of these features is called the "lookahead downloader" and it's used to quickly scan the page as it comes in, looking for the URLs of resources which will be needed later in the rendering of the page (for instance, JavaScript or CSS files). The lookahead downloader runs ahead of the main parser and is much simpler-- its sole job is to hunt for resources that will be needed and get download requests for those resources out to the network request queue as quickly as possible. These download requests are called "speculative downloads" because it is not known whether the resources will actually be needed by the time that the main parser reaches the tags containing the URLs. For instance, inline JavaScript runs during the main rendering phase, and such script could (in theory) actually remove the tags which triggered the speculative downloads in the first place. However, this "speculative miss" corner case isn't often encountered, and even if it happens, it's basically harmless, as the speculative request will result in downloading a file which is never used.

IE8 Bugs and their impact
Unfortunately, since shipping IE8, we've discovered two problems in the lookahead downloader code that cause Internet Explorer to make speculative requests for incorrect URLs. Generally this has no direct impact on the visitor's experience, because when the parser actually reaches a tag that requires a subdownload, if the speculative downloader has not already requested the proper resource, the main parser will at that time request download of the proper resource. If your page encounters one of these two problems, typically:

  • The visitor will not notice any problems like script errors, etc
  • The visitor will have a slightly slower experience when rendering the page because the speculative requests all "miss"
  • Your IIS/Apache logs will note requests for non-existent or incorrect resources

If your server is configured to respond in some unusual way (e.g. logging the user out) upon request of a non-existent URL, the impact on your user-experience may be more severe.

The BASE Bug

Update: The BASE bug is now
 
fixed.

The first problem is that the speculative downloader "loses" the <BASE> element after its first use. This means that if your page at URL A contains a tag sequence as follows:

<html><head><base href=B><script src=relC><script src=relD><script src=relE><body>

which requests 3 JavaScript files from the path specified in "B", IE8's speculative downloader will incorrectly request download of URLs "B+relC", and "A+relD" and "A+relE". Correct behavior is to request download of URLs "B+relC", "B+relD", and "B+relE". Hence, in this case, two incorrect requests are sent, usually resulting in 404s from the server. Of course, when the main parser gets to these script tags, it will determine that "B+relC" is already available, but "B+relD", and "B+relE" have not yet been requested, and it will request those correct two URLs and complete rendering of the page.

At present, there is no simple workaround for this issue. Technically, the following syntax will result in proper behavior:

 <html><head><base href=B><script src=relC><base href=B><script src=relD><base href=B><script src=relE><body>

...but this is not standards-compliant and is not recommended. If the page removes its reliance upon the BASE tag, the problem will no longer occur.

Remember: The BASE bug is now fixed.

The Missing 4k Bug
The second problem is significantly more obscure, although a number of web developers have noticed it and filed a bug on Connect. Basically, the problem here is that there are a number of tags which will cause the parser and lookahead downloader to restart scanning of the page from the beginning. One such tag is the META HTTP-EQUIV Content-Type tag which contains a CHARSET directive. Since the CHARSET specified in this tag defines what encoding is used for the page, the parser must restart to ensure that is parsing the bytes of the page in the encoding intended by the author. Unfortunately, IE8 has a bug where the restart of the parser may cause incorrect behavior in the Lookahead downloader, depending on certain timing and network conditions.

The incorrect behavior occurs if your page contains a JavaScript URL which spans exactly the 4096th byte of the HTTP response. If such a URL is present, under certain timing conditions the lookahead downloader will attempt to download a malformed URL consisting of the part of the URL preceding the 4096th byte combined with whatever text follows the 8192nd byte, up to the next quotation mark. Web developers encountering this problem will find that their logs contain requests for bogus URLs with long strings of URLEncoded HTML at the end.

As with the previous bug, end users will not typically notice this problem, but examination of the IIS logs will show the issue.

For many instances of this bug, a workaround is available-- the problem only appears to occur when the parser restarts, so by avoiding parser restarts, you can avoid the bug.  By declaring the CHARSET of the page using the HTTP Content-Type header rather than specifying it within the page, you can remove one cause of parser restarts.

So, rather than putting

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

In your HEAD tag, instead, send the following HTTP response header:

Content-Type: text/html; charset=utf-8

Note that specification of the charset in the HTTP header results in improved performance in all browsers, because the browser's parsers need not restart parsing from the beginning upon encountering the character set declaration. Furthermore, using the HTTP header helps mitigate certain XSS attack vectors.

Summary
While these problems are significant, they are not so dire as some readers will conclude at first glance. The second bug, in particular, is quite rarely encountered due to its timing-related nature and the requirement that page have a JavaScript URL spanning a particular byte in the response. Encountering the second issue is not nearly as prevalent as some web developers believe-- for instance, we've heard claims that IE6, 7, and Firefox all have this problem, which is, to the best of my knowledge, entirely untrue. Readers can easily determine if a page is hitting either bug by examining server logs, or watching network requests with Fiddler.

The IE team will continue our investigation into these bugs and, as with any reported issues, may choose to make available an IE8 update to resolve the issues.

Apologies for the inconvenience, and thanks for reading!

-Eric

Published Monday, July 27, 2009 5:49 PM by EricLaw

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Bugs in IE8's Lookahead Downloader

Thank you for tracking this issue.  We are experiencing this regularly (approx once every 2 hours) on our high volume ASP.NET site.

Outside of the charset change you mentioned, is there anything else web developers can do to prevent parser restarts in IE8?

Any insight is appreciated.

Tuesday, July 28, 2009 1:56 PM by Scott S.

# re: Bugs in IE8's Lookahead Downloader

@ScottS: I assume you're saying you hit the 4k issue, and not the "BASE" issue, as the latter will occur reliably on every request.

If you can send me the HTML (or a network capture: www.fiddler2.com) of the affected page, I'll have a look to see if there's any other cause for the parser restart. Email me at microsoft.com, username ericlaw

Tuesday, July 28, 2009 4:11 PM by ieblog

# re: Bugs in IE8's Lookahead Downloader

The second bug is an issue for all developers who align their code to 4096 bytes in order to make it run faster on Win98 :o)

Monday, August 03, 2009 6:39 AM by baltazzarr

# re: Bugs in IE8's Lookahead Downloader

Thank you Eric for such a comprehensive analysis. I emailed you a few weeks ago about this issue. This is great to see that you guys found the root cause of this problem that is indeed obscure.

Monday, August 03, 2009 9:32 AM by DmitryK

# re: Bugs in IE8's Lookahead Downloader

Wow!  That Missing 4K bug seems to be exactly the problem I've been trying to solve on my high traffic ASP site.  I've spoken to Eric Lawrence during the IE8 expert chats, and am incredibly glad he was able to figure this guy out.

Thursday, August 06, 2009 3:20 PM by Tim McGookey

# re: Bugs in IE8's Lookahead Downloader

Glad to see you tracked down this bug. Thanks for your detailed explanation on all this.

Do you have an estimation on when the fix will be available ?

Tuesday, August 11, 2009 9:42 AM by Olivier Jaquemet

# Beware of CSS and shortcut icon too

Also beware that the problem can also occurs for resources other than JavaScript.

For example CSS and shortcut icon :

<link rel="stylesheet" href="path-to-stylesheet.css" type="text/css" media="all" />

<link rel="shortcut icon" href='path-to-favicon.ico' />

Tuesday, August 11, 2009 11:01 AM by Olivier Jaquemet

# re: Bugs in IE8's Lookahead Downloader

I had

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

in my HEAD tag, and  using Wireshark I could see IE8 requesting the external JavaScript + CSS files only to immediately send a "TCP Reset" to kill the sockets, and then requesting the files again....

changing the meta to :

<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>

fixed the problem....

Friday, August 14, 2009 5:46 PM by FasyHack

# re: Bugs in IE8's Lookahead Downloader

The lack of standard BASE compliance (in a browser touted as being more complient) is a show stopper bug for us.

I just spent a LOT of time try to figure out why our authentication system was returning a 404 error... and it's because of this bug.

Here's a common situation that this bug breaks:

A secure site with only files in the /login directory viewable by the public.

When a secure file is asked for, the user is redirected to a login page via a "/servlet/login" request.  

The login page has a BASE tag to get all the CSS, images, etc from the /login directory.  All of which have no security attached.

However, the IE8 (let me tell you where to go) optimistic code, uses the "/servlet/login" to create a secured non-existant URL, e.g. /servlet/login/login.css.

AND IT MAKES THIS REQUEST BEFORE the user entered URL is requested.

So, when the user asks for /foo.html, IE8 actually asks the system for /servlet/login/login.css first.  The security system does what it's supposed to... says, I need you to authenticate before I can confirm or deny this files existance.

The user login in, thinking they are going to /foo.html, but the authentation system has been given a non-existing URL first.

The user see's a 404 file not found error, and our support lines light up because they have been told to get /foo.html (wich they can if the request it after authenticating).

Sorry to sound bitter but this has caused us a lot of grief, especially since IE8 is a highly recommended update.  

IMHO, this would be marked as a SHOWSTOPPER or CRITICAL bug in anyone issue system.  PLEASE fix it MS.

Before you say "just fix the login page..."  we use this in 80+ sites used by our clients (mostly fortune 500 companies).  Time is money... and IE8 is costing us by not being compliant with the standards.

Thursday, August 20, 2009 4:01 PM by CG Monroe

# re: Bugs in IE8's Lookahead Downloader

@CGMonroe: The BASE issue has nothing in common with standards compliance in general. As stated, this bug is a regression, pure and simple.

I'm not sure I understand the rest of your message. IE makes an invalid speculative download request, which fails. Then, later, it makes a non-speculative download request for the proper URL.

It's not at all clear why this is a "show stopper" bug for you. Does your 404 response delete the user's cookies or something like that?

If you have a public URL, I'd be happy to take a look.

Thursday, August 20, 2009 5:12 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Trying to post long comment... testing to see if there is a problem.

Friday, August 21, 2009 3:12 PM by CG Monroe

# re: Bugs in IE8's Lookahead Downloader

@CG: Comments with URLs in them are often blocked as spam.

However, before you resend, please understand two factors:

1> This is a bug. A plain old boring bug. Bug. You need not bother quoting the HTML spec to show that it's a bug. Everyone agrees that it's a bug.

2> You seem to assume that the user will see or be redirected to an error page due to this bug. That's not the case, as the result from the failed lookahead download is simply discarded because the parser uses the proper URL.

Friday, August 21, 2009 3:26 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Something in my long reply is causing the comment system to choke.. probably as designed.

Anyway, here a URL to what I was trying to post here:

http://dl.getdropbox.com/u/1701672/IE8-Base-bug.txt

Friday, August 21, 2009 3:29 PM by CG Monroe

# re: Bugs in IE8's Lookahead Downloader

As noted, please see my comment above.

Friday, August 21, 2009 3:34 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Sigh... but I have documented and personally seen that in the case of a secure site, this bug WILL cause the display a 404 to users... because of this bug.  But, you've made up your mind.. so I'll move on.

Friday, August 21, 2009 3:42 PM by CG Monroe

# re: Bugs in IE8's Lookahead Downloader

@CG: I'm more than happy to look at any repros, but if you see a redirection to a 404 page, it's not related to this bug.

www.fiddlercap.com shows how to gather a network capture for me to look at, if it's not a public site.

Friday, August 21, 2009 3:47 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

In thinking on how to collect info on this bug, I realized that this problem can be reproduced using the standard J2EE web app security constraints.

Here's a demo site with downloadable code (since none of it's proprietary).

http://www.skylarking.org:8180/ie8-bug

Note the port number and that since it's running on my personal server via RR, I may pull the plug on this in a few weeks or so.  

Tuesday, August 25, 2009 1:41 PM by CG Monroe

# re: Bugs in IE8's Lookahead Downloader

@CG: I'm not sure I understand your repro.  Here's the HTTP Traffic:

--------

GET http://www.skylarking.org:8180/ie8-bug/private/

200 OK

GET http://www.skylarking.org:8180/ie8-bug/login/login.js

304 Not Modified

[**** INCORRECT LOOKAHEAD DOWNLOAD HERE ****]

GET http://www.skylarking.org:8180/ie8-bug/private/login.css

200 OK

[*** CORRECT URL RETRIEVAL ***]

GET http://www.skylarking.org:8180/ie8-bug/login/login.css

304 Not Modified

[*** YOUR CODE REDIRECTS TO AN ERROR PAGE ***]

POST http://www.skylarking.org:8180/ie8-bug/login/j_security_check

302 Moved Temporarily to http://www.skylarking.org:8180/ie8-bug/private/login.css

GET http://www.skylarking.org:8180/ie8-bug/private/login.css

404 Not Found

--------

As you can see, the "j_security_check" page redirects, using a HTTP header, to an invalid URL. Hence, it is your server that is navigating the browser to the incorrect target URL.

Why it does that, I cannot tell for sure. My assumption would be that there's a session variable on the server that keeps track of the last "protected URL" requested and navigates the user to that page after login, but such a feature is under the control of the server, not the client. Such an architecture is not common, and as I noted above: "If your server is configured to respond in some unusual way (e.g. logging the user out) upon request of a non-existent URL, the impact on your user-experience may be more severe." From the looks of it, this applies to your design.

Tuesday, August 25, 2009 2:00 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Yes, the session tracking the last protected URL is the behaviour that is happening.  You get the same behaviour in other browsers if you put a link statement to a protected css file on the login page.

But some important points here are:

First, the authentication method is not MY code... this example is based on Tomcat's implementation of the Java Servlet API's security definitions. Most likely, the same error will occur on any standard Java webapp platform, e.g. JBoss, Websphere, and the like.

The use of a BASE tag for "view" elements like the login.jsp example is not that uncommon.

The HTML generated does refer any anyway to the invalid login.css URL... It's written correctly to all standards. The tracking of the last called protected URL is not the bug, it is IE's disreguard of the Base tag that is causing the problem.

Finally, you asked a while back, why should this be considered a show stopper or critical bug... hopefully, this discussion has shown that this bug is not just a "nuisance" bug but it can cause problems for a wide set of web applications that require security.  I would hope that this discussion finds it's way into the MS bug priority setting and that a this problem will be fixed in an update cycle.

Oh, should have said this sooner.. Thank you for finding the underlying IE bug in the first place!

Tuesday, August 25, 2009 4:48 PM by CG Monroe

# re: Bugs in IE8's Lookahead Downloader

@CG: Thanks for the clarification.

If the architecture used on your site was widespread, it's unlikely that it would have taken this long to discover; it would have likely been discovered in one of the beta cycles.

As it stands, it's still a significant bug, both for the corner cases where there is an end-user impact, but also for the performance implications. Lookahead downloading is intended to make the browser faster, not slower. :-)

Tuesday, August 25, 2009 5:12 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

My beautiful, long-in-the-making, highly admired, highly sophisticated, super secure business application has suddenly been rendered unusable by the 'base tag' bug.

At least there is Firefox...

Is there going to be a fix (?)

Thursday, August 27, 2009 11:23 AM by Harry Mantheakis

# re: Bugs in IE8's Lookahead Downloader

CG: before the days of stick everything in session variables, typically you rediected people to /login?ref=/secureUrl.

This is also causing us issues where its causing an extra 20 requests ( for all the .js files ) to our app servers for each page request.

Thursday, August 27, 2009 1:50 PM by OliD

# re: Bugs in IE8's Lookahead Downloader

The Missing 4k Bug:

The article states: "By declaring the CHARSET of the page using the HTTP Content-Type header rather than specifying it within the page, you can remove one cause of parser restarts."

Eric in an email:

"Unfortunately, another known cause of parser restarts is use of XML namespaces, which your site appears to use." So if you use XHTML the 4K issue can occur!

Tuesday, September 01, 2009 8:45 AM by hofstee

# re: Bugs in IE8's Lookahead Downloader

The BASE-tag bug is causing our customers much grief as well. Our system is based on the BASE tag as our pages is rendered by a servlet which is located in another directory than the css- and js-files that we refer to in the head-tag on all pages.

The third-party servletexec that we use is logging every request for a non-existing file as an invalid call for a non-existing class. The user is not affected by this, but our server is being bogged down by the enormous amount of logging that we can not disable. Introducing extra BASE-tags in our pages is not an alternative, and non-standard at that.

A "smart" downloader is only smart if the number of requests sent to the server is the same or reduced, but this generates a lot more requests than necessary.

Thursday, September 03, 2009 5:45 AM by David

# re: Bugs in IE8's Lookahead Downloader

<<A "smart" downloader is only smart...>>

David, let me reiterate because clearly you missed it:

This is a bug. A plain old boring bug. Bug. Bug. Bug bug bug.

Thursday, September 03, 2009 10:55 AM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

No, I didn't miss the "This is a bug"-part...

So, when are we going to see a fix for this, not only boring bug, but a bug killing business for a lot of people?

Friday, September 04, 2009 7:14 AM by David

# re: Bugs in IE8's Lookahead Downloader

So much drama here.

Harry/David: If one bug in one browser "kills" your business, I think your business suffers from some more fundamental problems.

It sounds like you already know how to workaround this problem, and refuse to do so.

Friday, September 04, 2009 11:16 AM by Bob

# re: Bugs in IE8's Lookahead Downloader

@Bob - Why should we not "refuse" to redesign our solution and deploy new code to our customers that doesn't follow standard in order to counter a problem in a faulty browser?

Monday, September 07, 2009 4:21 AM by David

# re: Bugs in IE8's Lookahead Downloader

David: You're missing the point.

There are two possibilities:

1> This bug doesn't "kill" your business, and you were just being sensational/dramatic.

2> This bug does somehow "kill" your business. In this case allowing your business to die because you're married to "standards" ("to death do you part") is an option, although a rather unusual choice.

Tuesday, September 08, 2009 1:28 PM by Bob

# re: Bugs in IE8's Lookahead Downloader

Drama or not... Possible to work around the bug or not...

The underlying issue is still if or when MS will fix this. As with any bug, the question of priority comes up and that is based on a lot of factors including impact on your users.

There is also a question of commitment to your own company/product's stated goals.  There was much fanfare with IE about it being more standards complient and developers not needing to do all the tricks they needed to do to get things to "behave" the same across different browsers.

There always are fixes to browsers misbehaving.. but it has been illustrated here that IE8 has yet another quirk that developers have to either know about or find the hard way when code written to standards doesn't work.

I hope the people who rank and priortize bugs are not being blinded by the drama, but are thinking about MS's stated commitment to have IE be standards complient (so we all start complaining about FF/Chrome compliant bugs :) ) and the fact that it's been shown to be more than some extra 404 entries in logs.

Wednesday, September 09, 2009 11:41 AM by CG Monroe

# re: Bugs in IE8's Lookahead Downloader

We have the same problem. when a fix ?

Wednesday, September 16, 2009 2:35 PM by Max

# re: Bugs in IE8's Lookahead Downloader

The ISSUE is how much time you waste in trying to determine if the bug is in the browser, or your software, and then develop a fix.

IE yet again proves to be a browser with some evil bad gotchas, which waste valuable developer time.

IE 8 is just another release which proves the old adage "Lets make the site work for standards compliant browsers, and then we will fix it for IE"

Too bad you can't invoice MS for your wasted hours.

I'm having to track down a different IE-8 related bug... :P

Monday, September 21, 2009 6:40 AM by Dan

# re: Bugs in IE8's Lookahead Downloader

Eric-

is there a more exhaustive list of tags that can cause the lookahead downloader to reset?  Our web-app doesn't use the BASE tag, and rarely uses the meta tag to set the charset, which we're already specifying in the HTTP headers.  I'd love to reduce the amount of spam our error tracking software generates, thanks to the 404s, and every little bit helps.

Monday, September 21, 2009 10:36 AM by Tim McGookey

# re: Bugs in IE8's Lookahead Downloader

@Tim: Unfortunately, as @hofstee mentioned, I believe that XML Namespace declarations (commonly used in XHTML) also trigger the restart logic.

Monday, September 21, 2009 11:13 AM by EricLaw [MSFT]

# re: Bugs in IE8's Lookahead Downloader

@EricLaw

Are the base tags, the meta tags, and the XML declarations all that we know so far?  What I'd love to be able to do is go to my developers with a list of problematic tags and say "fix these, and the e-mails will stop."

Friday, September 25, 2009 1:55 PM by Tim McGookey

# re: Bugs in IE8's Lookahead Downloader

@Tim: Unfortunately, I wouldn't feel confident in suggesting that XML Namespaces and META tags are the only cause of restarts, because I know very little about the overall parsing architecture.

The BASE tag is obviously the biggest cause of incorrect requests, because the incorrect speculative requests due to BASE are not at all related to timing.

While unfortunately I'm not able to make any statements or speculations about IE code fixes (either availability or timeframe) I can say that this is an issue that we're getting a significant amount of customer escalations about because the workarounds are unappealing.

Friday, September 25, 2009 2:26 PM by EricLaw [MSFT]

# re: Bugs in IE8's Lookahead Downloader

@EricLaw:

I appreciate everything you're doing for this problem.  Thanks for your help.

Friday, September 25, 2009 4:30 PM by Tim McGookey

# re: Bugs in IE8's Lookahead Downloader

And this bug will be fixed **when**?

Thanks.

Tuesday, September 29, 2009 4:50 PM by Randy Syring

# re: Bugs in IE8's Lookahead Downloader

Sorry Randy, as mentioned previously:

Unfortunately I'm not able to make any statements or speculations about IE code fixes (either availability or timeframe). I can say that this is an issue that we're getting a significant amount of customer escalations about because the workarounds are unappealing.

Tuesday, September 29, 2009 4:53 PM by EricLaw [MSFT]

# re: Bugs in IE8's Lookahead Downloader

Eric,

Sorry, I didn't catch that.  Thanks for responding.

Tuesday, September 29, 2009 5:30 PM by Randy Syring

# re: Bugs in IE8's Lookahead Downloader

Eric:

I appreciate you taking the time to investigate this issue and help the community.  I saw a post you made several months ago like so:

"If you can send me the HTML (or a network capture: www.fiddler2.com) of the affected page, I'll have a look to see if there's any other cause for the parser restart. Email me at microsoft.com, username ericlaw"

Here is my issue, we are definately getting the 4096 K bug.  Our site is ASP.net 3.5 and we get the invalid viewstate error on DecryptStringIV, etc.  I can tell you for a fact this ALWAYS seems to focus around ScriptResource.axd and WebResource.axd.  We have a standard master page, css, etc.

The issue I'm having is its intermittent, occurs on various pages, so I can't send you a single HTML snapshot of the problem, since I also personally can't get it to fail.

Can you provide any insight, we do have a development server with a public ip where the full application is running.  Should I sent this to you via email? Can you help me? Given the facts I have presented what is the best way for us to combat this error.

Thanks

Friday, October 02, 2009 11:49 AM by Martin K

# re: Bugs in IE8's Lookahead Downloader

@Martin: Does your page use a META CHARSET tag that specifies a character set?  Do you specify any namespaces?

In terms of workarounds, I can think of several unappealing ones (e.g. use a comment at the top of the page that pushes all of the relevent script tags out of the 4096th byte).

Friday, October 02, 2009 1:41 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Eric:

Thanks for your reply.  We did a very simplistic/clean overall design for the web site.  We basically have a base aspx page which all other pages derive from.  We have a single Master Page that is used for all pages, etc.  We have all logic encapsulated within User Controls, ascx, etc.

Regarding your question.  In our Master Page this is defined:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<!--start content-->

<head runat="server">

Does this answer your question, its fairly vanilla we use standard CSS and JQuery as well, if that matters.

So is there anything we can do or do you see anything in the Master Page top declaration we could or should change that won't effect anything else?

What would be the least unappealing work around.  This is actually a part of a big eCommerce site and we use ELMAH nad IIS logging so we are flooded with this error for IE 8 users.

Thanks

Friday, October 02, 2009 8:49 PM by eeyore145

# re: Bugs in IE8's Lookahead Downloader

Sorry, eeyor145, but I'm pretty sure the XMLNS declaration ends up triggering a parser restart as well.

In terms of "least unappealing workarounds"-- I'm afraid I no longer have any.  I took a look at sticking a huge buffer comment just inside the HEAD tag to push the first script URL outside of the 4096th byte, but it looks (not surprisingly) like this impacts the 8192nd byte as well.

Friday, October 02, 2009 9:05 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Thank you Eric for clarifying the issue for us. As stated by many others I am also requesting that a fix be made available as soon as possible. Most high volume sites log errors and we are being flooded with these .. making our logging a pain to  analyze.At the very least IE should include the "lookahead downloader" in the user agent string.

Monday, October 05, 2009 3:44 AM by John Martelli

# re: Bugs in IE8's Lookahead Downloader

I am seeing the missing 4k bug about every two minutes on one of my sites.  Sure would like to see a fix.

Thanks.

Tuesday, October 06, 2009 4:34 PM by Joe Rattz

# re: Bugs in IE8's Lookahead Downloader

Would putting an IE conditional that re-states the base tag before each resource be considered standards-compliant or problematic?

<!--[if IE 8]><base href="blah.com" /><![endif]-->

<script type="text/javascript" language="javascript" src="foo/bar.js"></script>

<!--[if IE 8]><base href="blah.com" /><![endif]-->

<script type="text/javascript" language="javascript" src="foo/bar2.js"></script>

<!--[if IE 8]><base href="blah.com" /><![endif]-->

<link rel="stylesheet" href="foo/bar.css" type="text/css" />

Monday, October 12, 2009 11:51 AM by MrMotts

# re: Bugs in IE8's Lookahead Downloader

@MrMotts: That's a pretty unappealing workaround, but if you were to do it, you'd definitely want to use a proper URL as the HREF.

Monday, October 12, 2009 3:43 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

We're seeing this very frequently on three of our sites.  I've tried all the fixes that I can find suggestions for online, but nothing works.  Any update on where MS is with this would be huge.

Monday, October 12, 2009 4:08 PM by Bill

# re: Bugs in IE8's Lookahead Downloader

I'm getting this too. Come on MS, please give us a fix. I'm potentially missing out on real error notifications because of all the spam generated by this problem.

Tuesday, October 13, 2009 1:24 AM by Ben S

# re: Bugs in IE8's Lookahead Downloader

I just found an article that mentioned using this in the head of the HTML document to stop the IE8 issue:

<meta http-equiv="X-UA-Compatible" content="IE=7" />

I put that in for my 3 sites and it seems to be having a positive effect for now.  Is this a valid work around or should I stay clear of this?  Thanks!

Tuesday, October 13, 2009 10:18 AM by Bill Rowell

# re: Bugs in IE8's Lookahead Downloader

@Bill: Generally speaking, I would expect that to *worsen* the problem rather than making it better. Using the X-UA-Compatible flag likely causes a parser restart.

Tuesday, October 13, 2009 10:29 AM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Interesting.  I'll leave it be for now and see how often the error comes through.  I think I've only seen 1 since I put it in, but that could just be coincidence.

Are there any other work arounds I could try?  I've tried the Content-Type fix among others.  None of them seemed to do the trick.

Thanks Eric!

-Bill

Tuesday, October 13, 2009 10:53 AM by Bill Rowell

# re: Bugs in IE8's Lookahead Downloader

Thought I'd chime in as well.  We have 2 sites all using ms ajax.  Not high volume.

We are seeing the 4k bug pretty freqeuntly.  Like everybody else, have tried the workarounds suggested.

No joy.  

Out of desperation I am giving the last suggestion above (<meta http-equiv="X-UA-Compatible" content="IE=7" />) a blast.

No data to report yet but we'll see...

Come on MS this has been going on for too long.

Tuesday, October 13, 2009 1:56 PM by JG

# re: Bugs in IE8's Lookahead Downloader

Has anyone heard when or if a fix will be provided?

thanks

Tuesday, October 13, 2009 2:20 PM by tc

# re: Bugs in IE8's Lookahead Downloader

The BASE bug was fixed in today's Cumulative IE8 Update. http://blogs.msdn.com/ieinternals/archive/2009/10/13/Using-Meddler-to-Simulate-HTTP.aspx

@tc, to reiterate on your question about the 4k issue: "Unfortunately I'm not able to make any statements or speculations about IE code fixes (either availability or timeframe). I can say that this is an issue that we're getting a significant amount of customer escalations about because the workarounds are unappealing."

Tuesday, October 13, 2009 5:57 PM by EricLaw

# re: Bugs in IE8's Lookahead Downloader

Our users are seeing the 4K bug - it's causing 404 errors - that I cannot reproduce.  Please fix!  My client doesn't want to hear that I can't fix it and we're losing business.

Wednesday, October 14, 2009 8:34 AM by Jenn

# re: Bugs in IE8's Lookahead Downloader

@Jenn: Unless your client is actively monitoring their network traffic, it's unlikely that they are able to observe this problem.

For instance, if they're seeing 404 Error Pages, they're not hitting this issue-- your problem is elsewhere.

Wednesday, October 14, 2009 10:01 AM by EricLaw [MSFT]

# re: Bugs in IE8's Lookahead Downloader

We've been running our sites for a full day without any errors using this fix suggested by Bill Rowell.

<meta http-equiv="X-UA-Compatible" content="IE=7" />

Needs to be put before any linked files in the head.

I guess that for some people this may have side-effects but it is working a treat for us.

Wednesday, October 14, 2009 2:12 PM by JG

# re: Bugs in IE8's Lookahead Downloader

Our site has always had this meta tag (first tag under the head tag):

<meta http-equiv="X-UA-Compatible" content="IE=7" />

The problem still continues.

Wednesday, October 14, 2009 4:41 PM by Paul

# re: Bugs in IE8's Lookahead Downloader

RE: <meta http-equiv="X-UA-Compatible" content="IE=7" />

Okay a few more days have passed and we have had a few errors but it seems to have been vastly reduced.

So this is not a fix but somehow mitigates the problem slightly.

Monday, October 19, 2009 12:19 AM by JG

# re: Bugs in IE8's Lookahead Downloader

@JG: What you are seeing is probably some of your javascript references being pushed out of the problem area by the IE7 meta tag. This could be seen as a workaround but not a long term solution since the content in your pages changes anyway with future updates of your site.

You can achieve the same result with an HTML-comment of the same length as your IE7 meta tag.

Monday, October 19, 2009 3:31 AM by Thomas

# re: Bugs in IE8's Lookahead Downloader

We have had some code in the past that was moving ViewState to the end of the page form to help SEO.

I've been applying the same to the WebResource and ScriptResource script tags and can move them to the end of the form to get them away from the 4096th bit but because they are now loaded after, say, some Ajax on the page the Ajax doesn't work.

Trying a few things to get this working but for anyone interested this is what we're trying to do...

               int startPoint2 = html.IndexOf("<script src=\"/WebResource.axd?");

               if (startPoint2 >= 0)

               {

                   int endPoint2 = html.IndexOf("</script>", startPoint2) + 9;

                   string webresourceInput = html.Substring(startPoint2, endPoint2 - startPoint2);

                   int formEndStart2 = html.IndexOf("</form>");

                   if (formEndStart2 >= 0)

                   {

                       html = html.Remove(startPoint2, endPoint2 - startPoint2);

                       html = html.Insert(formEndStart2 - (endPoint2 - startPoint2), webresourceInput);

                   }

               }

Monday, October 19, 2009 5:23 AM by AC

# re: Bugs in IE8's Lookahead Downloader

For the "Missing 4K bug", I used Response.AddHeader("Content-Type", "text/html; charset=utf-8") in the Page_Load event. But when I view source, I don't see anything about Content-Type.

Was I doing it right, or that is just expected?

Thanks.

Tuesday, October 20, 2009 9:09 AM by meta

# re: Bugs in IE8's Lookahead Downloader

@meta: You're right, it's the expected behavior. The Content-Type directive is added to the HTTP header which can be viewed with excellent tools such as Fiddler (written by the writer of this blog), Firebug or Live HTTP headers among others.

Tuesday, October 20, 2009 11:44 PM by Thomas

# re: Bugs in IE8's Lookahead Downloader

This does not work for us: we are still getting the same number of errors per day

Tuesday, November 03, 2009 1:34 AM by John Martelli

# re: Bugs in IE8's Lookahead Downloader

<meta http-equiv="X-UA-Compatible" content="IE=7" /> does not work for us: we are still getting the same number of errors per day

Tuesday, November 03, 2009 1:35 AM by John Martelli

# re: Bugs in IE8's Lookahead Downloader

Is there an easy way via Fiddler/whatever to figure out exactly where the 4096 byte is in the response?

Thanks!

Tuesday, November 03, 2009 7:07 AM by jeff

# re: Bugs in IE8's Lookahead Downloader

@Jeff: Sure thing.

1> Update to the latest version of Fiddler.

http://www.fiddler2.com/dl/fiddler2betasetup.exe

2> For any given response, go to the HexView tab and scroll down until the status bar indicates "4096 (0x1000) of body"

Tuesday, November 03, 2009 7:27 AM by EricLaw [MSFT]

# re: Bugs in IE8's Lookahead Downloader

Might be a stupid question, but is there an easy way to translate where you are in the hex view to where that corresponds to in the Raw/Text/whatever view?

Tuesday, November 03, 2009 2:53 PM by jeff

# re: Bugs in IE8's Lookahead Downloader

@Jeff: Not really. The problem is that the other views interpret CRLF (end of line) as just that, while in the hex view, they're rendered as encoded bytes.

Tuesday, November 03, 2009 5:44 PM by EricLaw [MSFT]

# re: Bugs in IE8's Lookahead Downloader

We are constantly hitting this problem. We don't use the "base" tag and also don't have the META tag in our page and fiddler shows we have "Content-Type: text/html; charset=utf-8" so we must be hitting one of the other causes of this bug.

Thanks for looking at it though. Hopefully you find a solution. As I am now putting in some special code into our exception handling mechanism to not be reported on this bug anymore as it is spamming my mailbox with exception emails.

Wednesday, November 04, 2009 3:05 PM by Gerard van de Ven

# re: Bugs in IE8's Lookahead Downloader

Hi Eric,

We are seeing this problem, but ONLY in our production environment.  I am unable to reproduce in any other environment.

IIS configuration is identical on production and staging/dev.  The only difference is that Production is load balanced.  I've verified that the machineKey information is identical on both machines and session variable are stored in a Session database on SQL.

Any thoughts?

Tuesday, November 24, 2009 7:23 AM by Chris

# re: Bugs in IE8's Lookahead Downloader

We are in the same situation as Chris.  Our production servers are load balanced.  We are significant number of 404 errors due to the bug.  

Just like others here we cannot reproduce the bug on our developer servers.  

Tuesday, November 24, 2009 11:40 AM by Jim T

# re: Bugs in IE8's Lookahead Downloader

I also noticed that when I review my IIS logs, I find entries that dont necessarily match the date/time stamp of the error in the event log.  

When I am able to find the errors, I see thats that these requests return a 200 status????

Tuesday, November 24, 2009 12:44 PM by Chris

# re: Bugs in IE8's Lookahead Downloader

Jim T -- are you using Google Campaign tracking by any chance?  Im seeing that most of my requests that contain this information is throwing the exception in the logs, but normal generic traffic to the site is not -- Im hoping this explains why DEV/STAGE and Prod are showing 2 different behaviours

Tuesday, November 24, 2009 12:51 PM by Chris

# re: Bugs in IE8's Lookahead Downloader

>> Jim T -- are you using Google Campaign tracking by any chance?

No, we don't.

Tuesday, November 24, 2009 2:25 PM by Jim T

# re: Bugs in IE8's Lookahead Downloader

@Chris/JimT: As our developers investigated the problem, we found that there are a number of timing scenarios which can result in the buggy behavior seen when the parser restarts.

Unfortunately, this means that in practice, there isn't any viable workaround for web content that would resolve all forms of the problem.

Tuesday, November 24, 2009 3:47 PM by EricLaw [MSFT]

# re: Bugs in IE8's Lookahead Downloader

@Chris

We are in the same situation.

Load balanced servers in production, same machine keys across the web farm, and we see this conistently in production, but we HAVE also seen it in our QA/Staging environments.

Very few times though compared to production.

We have a very robust logging system in our application that captures all of these events, and are registered as many different types of errors:

Invalid Viewstate

Invalid character in a Base-64 string

Invalid length for a Base-64 char array

Length of the data to decrypt is invalid

This is an invalid script resource request

This is an invalid webresource request

I actually reproduce the issue by chance myself, and attached to the debugger IE 8 provides, and found that a validator that's required on a page was erroring out since the script.axd didn't load properly.

I wasn't able to confirm that it eventually 'did' load, and that the error I saw was during the pre-parsing, but nevertheless, the error WAS customer facing and this issue is causing a serious headache for us.

Eric,

Any update on the status of a possible fix? Or do you have any suggestions for us?

Could we insert a block "IF IE 8" that would push content past the span of bytes that cause the issue?

Tuesday, December 01, 2009 9:03 AM by Mark D

# re: Bugs in IE8's Lookahead Downloader

@Mark, as noted in the comments above, unfortunately I'm not able to make any statements or speculations about IE code fixes (either availability or timeframe). I can say that this is an issue that we're getting a significant amount of customer escalations about because the workarounds are unappealing.

In terms of "least unappealing workarounds"-- I'm afraid I no longer have any.  I took a look at sticking a huge buffer comment just inside the HEAD tag to push the first script URL outside of the 4096th byte, but it looks (not surprisingly) like this impacts the 8192nd byte as well, and so on.

Tuesday, December 01, 2009 9:37 AM by EricLaw [MSFT]

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker