Advantage and Diadvantage of CGI
Advantage of CGI
Some of the advantages of Common Gateway Interface are:
- CGI scripts are portable in nature.
- They are language independent, as we can write them in any language, instead of being stuck to any specific language.
- CGI can perform both easy and complex tasks efficiently, which makes it scalable as well.
- It also helps in dynamic communication as well.
Diadvantage of CGI
Along with advantages, CGI or Common Gateway Interface also has some of its disadvantages. Those are:
- The CGI scripts may create a lot of traffic since there are a lot of requests from the client-server.
- Sometimes, it maybe very complex to design and program the CGI scripts.
- CGI programs maybe a little vulnerable regarding the security considering how freely they are available.
Historical context and evolution of CGI.
When you click on any of the links on the webpage, your browser contacts the HTTP web server and demands the URL that is, the filename, and the web server passes the URL and looks for the filename, if it finds that file, it will send it back to the browser otherwise sends an indicating message that you have requested a wrong file. Then, the web browser takes a response from the web server and displays either the received file or the error message. However, it is possible to set the HTTP server so that whenever a file in a certain directory is requested, that file is not sent back. Instead, it is executed as a program. And, whenever that program shows any output, it’s sent back to the browser to display. So, this function is called Common Gateway Interface or CGI, and the program scripts are called CGI Scripts. These CGI scripts can be a Python script, PERL script, Shell script, C or C++ program, etc.
Contact Us