Common Gateway Interface
The Common Gateway Interface (CGI) is the standard process that uses a set of rules to propagate the user´s request to the web resources such as web server or web application program and respond to the user through the web interface. CGI includes several working scripts and programs for web communication. CGI is the mechanism that is part of the Hypertext Transport Protocol (HTTP). One of the examples of CGI flow is the Web browsers send the forms data to the backend server, and CGI connects to the application program on the web-server and the program response to the web browser.
CGI Architecture
Features of CGI
- It is a very well defined and supported standard.
- CGI scripts are generally written in either Perl, C, or maybe just a simple shell script.
- CGI is a technology that interfaces with HTML.
- CGI is the best method to create a counter because it is currently the quickest
- CGI standard is generally the most compatible with today´s browsers
Advantages of CGI
- The advanced tasks are currently a lot easier to perform in CGI than in Java.
- It is always easier to use the code already written than to write your own.
- CGI specifies that the programs can be written in any language, and on any platform, as long as they conform to the specification.
- CGI-based counters and CGI code to perform simple tasks are available in plenty.
Disadvantages of CGI
- In Common Gateway Interface each page load incurs overhead by having to load the programs into memory.
- Generally, data cannot be easily cached in memory between page loads.
- There is a huge existing code base, much of it in Perl.
- CGI uses up a lot of processing time.
Next Topic :CGI vs Servlet