2025-04-27 07:49:33 -04:00

93 lines
6.7 KiB
HTML
Raw Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Client Capabilities</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
TempString = navigator.appVersion
if (navigator.appName == "Microsoft Internet Explorer"){
// Check to see if browser is Microsoft
if (TempString.indexOf ("4.") >= 0){
// Check to see if it is IE 4
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else {
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
}
}
else if (navigator.appName == "Netscape") {
// Check to see if browser is Netscape
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
//-->
</script>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()
Dim frmContents
On Error Resume Next
If Not Parent Is Nothing Then
Set frmContents = Parent.Contents
If Not frmContents Is Nothing Then
frmContents.Window.TOCSynch_Click
End If
End If
End Sub
//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="MS-IT-LOC" Content="Internet Information Services">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H3><A NAME="_k2_client_capabilities"></A><SUP></SUP>Client Capabilities</H3>
<P>One of the more significant design decisions you will make is how your application will handle differing client capabilities. For example, one of the most important issues for users is the speed of the connection. If your application can determine this speed, it can adjust the response to match that capacity. The only way for your application to be aware of the current connection speed is if the client includes this information as part of its request.</P>
<P>You can solve the client capabilities problem on either the client side or server side. The client-side solution relies on <A HREF="/iishelp/iis/htm/asp/eadg39v0.htm">Dynamic HTML</A> (DHTML) to include a description of the client's current configuration as part of the request, as depicted in the graphic below.</P>
<P><IMG SRC="/iishelp/iis/htm/asp/art/browcap3.gif" ALT="Browser Capabilities" BORDER=0></P>
<P>The benefits of this approach include:
<UL type=disc>
<LI>Reduction in roundtrips between the client and server.</li>
<LI>Reduced load on the server.</li>
<LI>Improved application responsiveness due to proxy server caching technology.</li>
</UL>
<P>There are some situations where client-side scripting will not be feasible. For example, applications that are exposed on the Internet cannot guarantee that the client will support scripting, which means the applications may fail for some clients. In addition, server-side resources may not be accessible from the client side, as the client may reside on a network that does not allow scripting for security reasons.</P>
<P>The server-side approach relies on the <A HREF="/iishelp/iis/htm/asp/comp3xx0.htm">Browser Capabilities component</A>. This component reads the User Agent HTTP header included with the request to determine the client's capabilities. The version of the Browser Capabilities component that shipped with IIS 3.0 and 4.0 determined client capabilities by looking them up in a static list. The following graphic shows the sequence of events.</P>
<P><IMG SRC="/iishelp/iis/htm/asp/art/browcap1.gif" ALT="Browser Capabilities" BORDER=0></P>
<P>This approach presented difficulties for application designers when the list became out of date. More importantly, this technique did not cover configurable aspects of a client's capabilities and did not provide a means of what was actually <I>enabled</I> at the time the request was made.</P>
<P>In IIS 5.0, the Browser Capabilities component was improved to overcome these earlier design limitations. It can now be modified for an individual request by the client returning a cookie describing its capabilities. In addition, if the initial request for an .asp file does not include a cookie, you can call back to a script that will run on the client in order to create the cookie. The following illustration shows the sequence of events.</P>
<P><IMG SRC="/iishelp/iis/htm/asp/art/browcap2.gif" ALT="Browser Capabilities" BORDER=0></P>
<P>This improvement to the Browser Capabilities component creates another alternative to the server-side solution. This technique uses a special status code to call back to the client when a request comes in that does not include a cookie. You can generate this status code by placing a special meta tag as the first line in your .asp file. For example:</P>
<PRE><CODE>&lt;!-- METADATA TYPE="Cookie" NAME="BrowsCap" SRC="sendcook.htm" --&gt;
</CODE></PRE>
<P>instructs IIS to send the special status code<64>an HTTP 449 status code<64>to Internet Explorer 5; it then tells Internet Explorer 5 to run the script in Sendcook.htm, which will generate a cookie describing the client capabilities. When the server receives this cookie, it will use it in conjunction with the Browser Capabilities component to determine how to send the response back to the client.</P>
<P><span class=le><B>Important&nbsp;&nbsp;&nbsp;</B></span>If the METADATA meta tag exists in a file that is requested by the client as a result of a redirection using the <A HREF="/iishelp/iis/htm/asp/vbob9waa.htm"><B>Server.Transfer</B></A> or <A HREF="/iishelp/iis/htm/asp/vbob9pid.htm"><B>Server.Execute</B></A> methods, IIS will ignore the meta tag. METADATA meta tags in the file that actually contains the redirect, however, will be processed normally.</P>
<P>For more details on how to use this feature, see <A HREF="/iishelp/iis/htm/asp/comp1vol.htm">Retrieving Browser Capabilities from a Cookie</A>.</P>
<P>For more information on DHTML client capabilities, see the DHTML reference information on <a HREF="http://go.microsoft.com/fwlink/?LinkId=1694" target="_blank"><b>MSDN Online</b></a>. For an example of the new Client Capabilities component functionality, see the <b>ASP Samples</b> in the IIS section of the Platform SDK or at <a href="http://go.microsoft.com/fwlink/?LinkId=1753" target="_blank">MSDN Online - Internet Information Services</a>.</P>
<hr class="iis" size="1">
<p align="center"><em><a href="../../../common/colegal.htm">&copy; 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
</BODY>
</HTML>