Kbase 31574: CGI vs ISAPI
Autor |
  Marcos Kirchner - CAT |
Acesso |
  Público |
Publicação |
  04/08/2005 |
|
ISAPI server extensions provide an alternative to the use of Common Gateway Interface (CGI) applications for Internet servers. Unlike CGI applications, ISAs run in the same address space as the HTTP server and have access to all the resources available to the HTTP server. ISAs have lower overhead than CGI applications because they do not require the creation of additional processes and do not perform time-consuming communications across process boundaries. Both extension and filter DLLs may be unloaded if the memory is needed by another process.
CGI IIS 5.0 fully supports both scripts and executables written to the CGI specification. IIS 5.0 supports scripts written in a variety of languages when the appropriate Win32 script interpreter is installed and configured, for example, Perl, Python, TCL, REXX, and JScript. It also supports scripts written in VBScript that have been modified to support standard input and output variables. As a result, many CGI applications can be ported to IIS 5.0 with minimal changes.
ISAPI Extensions ISAPI extensions consist of multithreaded DLLs loaded into IIS 5.0. ISAPI extensions have a strong performance advantage over CGI applications for several reasons. First, ISAPI extensions can be configured so all of them run in a single process, or so they run in the same memory space as the Web service. Second, instead of loading an executable for each request, ISAPI uses thread-safe DLLs that are loaded only once. Finally, ISAPI uses Win32-based APIs to communicate with the Web service, which is much faster than CGI methods. ISAPI extensions developed for other Web servers are generally easy to port to IIS 5.0. In addition, it is sometimes advantageous to rewrite existing CGI applications as ISAPI extensions to improve their performance, as discussed later in this section.