CGIThe First Generation of Dynamic Content Generation Tools


CGI”The First Generation of Dynamic Content Generation Tools

In the early days of the World Wide Web, most content available was static in nature. One of the first Web servers available came from CERN, the European Organization for Nuclear Research in Switzerland. It released httpd, its Web server, in June 1991. At that time, a Web author would create pages, often with just a text editor, and publish them on a Web site. Most sites were very small by today's standards and could be easily maintained by a few people. Changes to the content of a page or of the site had to be changed by hand by the content authors.

However, Web authors quickly realized that it was also important to make dynamic content available. For example, a content author may want to present information stored in a database. In November 1993 the CERN httpd Web server was updated to include what would eventually be known as the Common Gateway Interface or CGI.

CGI specifies an interface between a Web server and an external program. The external program could, for example, query a database, generate an HTML table of the results, and supply the HTML stream back to the Web server. The Web server would then send the stream back to the browser client.

CGI solves much of the problem of generating dynamic content. However, it is not without its faults. The primary issue with CGI is that it is traditionally implemented via a separate operating system process from the Web server. This means that for every request for dynamic content a new operating system process has to be created, initialized , and run. Then the results from that external process are fed back into the Web server to be passed on to the browser. The separate process then ends, losing any work already done, such as creating database connections.

A secondary issue is the definition of the interface itself. Because of its roots, CGI defines a very simple interface between the Web server and the CGI program that is being run. Basically a set of key/value pairs are passed from the Web server to the CGI program and the CGI program is responsible for generating the entire HTTP response. Although this simplifies implementation, it does not encourage good programming practices like using object-oriented programming.

There have been improvements in the CGI model over the years . The main improvement is building interpreters such as Perl or PHP into the Web server. This allows, for example, Perl CGI scripts to run in the same process space as the Web server, improving the scalability of the server. Because the server no longer has to create a new process for every request for dynamic content, a single server can handle a greater number of client requests . However, because these languages are still interpreted there are still scalability issues with this solution.



BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net