Common Gateway Interface (CGI)

Definition - What does Common Gateway Interface (CGI) mean?

Common Gateway Interface (CGI), in the the context of web development, is an interface for running executables via a web-server. In most intances, this means taking an HTTP request and passing it to an application in order to deliver a dynamically-generated HTML page back to a browser. While pretty much any program that can run on a web server is usable as a CGI script, Perl is the most popular language.

The standard for CGI is defined in RFC 3875.

Techopedia explains Common Gateway Interface (CGI)

In the early days of web development CGI was one of the few ways to provide interactivity in a web application. It was most common on Apache, but ports were made to run CGI on IIS as well.

The most common usage of CGI is using scripting languages, and so it's common to refer to this as running a CGI script. CGI programs and scripts are usually collected in a folder named /cgi-bin/.

The main disadvantage of CGI is that each page load incurs overhead by having to load the programs into memory. Data cannot easily be cached in memory between page loads. Because of this disadvantage, many developers have moved to application servers that remain running. However, there is a huge existing code base, much of it in Perl. Proponents of CGI argue that it is simple, stable, and a good choice for certain applications, especially involving tasks where Perl excels, such has text handling. Workarounds also avoid loading in the Perl or PHP runtime for each request by including the runtime in the web server (mod_perl and mod_php in Apache), or other solutions such as FastCGI (separate processes that handle multiple requests).

This definition was written in the context of Web Development
Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.