Article

Advanced Web Design: A Primer

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 Next

Common Gateway Interface (CGI)

The Common Gateway Interface, or CGI, is a standard that allows a Web server to execute an external program and send its output to a Web browser that requested it. Thus, a CGI-capable Web server, when receiving a request for, say, “medalstandings.exe”, will not simply send that file to the browser. Instead, it will recognize the file as an executable program and run it. The Web server captures the output (which is usually an HTML document, but could be anything from a GIF image to an Adobe Acrobat document) and sends it to the Web browser in response to the request.

CGI was the original method of creating dynamic Web applications. You can write a program in C/C++, Perl, or whatever language can run on your Web server computer, and tell the Web server to treat it as a CGI program. CGI has become very unpopular lately with the rise of server-side scripting languages (which we’ll look at in a moment), because with CGI the Web server has to launch an external program for every request. A site that gets 10,000 hits an hour will result in a lot of these CGI programs running at once, placing a tremendous strain on the Web server computer and slowing down access times to the site.

Resources:

If you liked this article, share the love:
Print-Friendly Version Suggest an Article