Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: Three GET Requests Are Sent When You Retrieve Plug-in Served Content


View products that this article applies to.

Symptoms

When a server returns a document that is handled by a plug-in (such as an Adobe Acrobat PDF file), three requests are made for the document in Internet Explorer versions 4.x and 5, and two requests are made in Internet Explorer version 5.5.

Occasionally, Internet Explorer determines the plug-in type; however, Internet Explorer still displays the broken plug-in icon instead of the document.

↑ Back to the top


Cause

The first behavior is by design. When an initial request is sent for the server file, this returns a data stream with a content-type that is handled by a plug-in (not an ActiveX control), and Internet Explorer closes the initial port and sends a new request with userAgent = contype.

The only information that is needed in return from the contype request is the content-type. However, because most developers are unaware of this request style, they treat each GET the same and return the entire document. This is where the second problem can manifest itself. Internet Explorer is hard coded to time out in only 10 seconds if the contype request is not answered. If you are reading large files from disk or opening a database to retrieve the file, you can easily exceed the 10 second time-out limit.

In Internet Explorer 4.x and 5, the browser first generates a GET request to the server. The server responds with the content-type, and the browser looks at the registry to check which application it will invoke. Then the browser generates a second GET request, and, after the server responds with the same content-type, the browser invokes the targeted application inside the browser window. Lastly, the browser sends a third GET request, and this time the browser renders the content of the server file inside the browser and completes the process.

Internet Explorer 5.5 uses the same method but sends two GET requests instead of three.

↑ Back to the top


Resolution

To work around this limitation and to considerably improve the performance of your application, watch for the "contype" userAgent request and only return the content-type.

If possible, configure the plug-in to operate as a helper application instead. Some plug-ins may not work in this mode, but it is a confirmed solution for PDF files and the Adobe Acrobat Reader.

Sample Solution for a PDF File

Access the PDF file through an HTML page that uses the <OBJECT> tag to specify the ActiveX control version of the PDF viewer as follows:
<HTML> 
<HEAD> 
</HEAD> 
<OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000"
STYLE="height:100%; width: 100%" >
<PARAM NAME="src" VALUE="http://server/path/filename.pdf">
</OBJECT>
</HTML>
				
NOTE: This only works if there is a file to specify for the src parameter and does not resolve the problem if the PDF file is sent as a binary stream.

↑ Back to the top


More information

Steps to Reproduce Behavior

  1. Request a plug-in readable file from a server (for example, a .pdf file).
  2. Use the Network Monitor tool to capture the network traffic.
  3. Filter the result by only selecting the HTTP protocol. Notice that three GET requests are generated to retrieve a single PDF file.

↑ Back to the top


References

For more information, see the following Microsoft Web sites:
Appendix A: MIME Type Detection in Internet Explorer
http://msdn2.microsoft.com/en-us/library/ms775147.aspx

Support WebCast: MIME Type Handling in Microsoft Internet Explorer
http://support.microsoft.com/servicedesks/webcasts/wc011101/wcblurb011101.asp
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
148942 How to Capture Network Traffic with Network Monitor
For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

↑ Back to the top


Properties

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

↑ Back to the top


Keywords: KB293792, kbprb, kbfix

↑ Back to the top

Article Info
Article ID : 293792
Revision : 4
Created on : 5/23/2007
Published on : 5/23/2007
Exists online : False
Views : 493