martedì 2 giugno 2009

Sorry, but what are FastCGIs?

A friend of mine asked me this question, an easy answer is that they are faster CGIs! Obviously now the question is “What are CGIs?”.

When the web was emerging there was the need to serve not only static pages, but also pages created just in time. The first, primitive answer was the Server Side Include (SSI) technology, useful to accomplish easy tasks, but inadequate to develop complex pages and sites. A better solution was the Common Gateway Interface (CGI), a standard protocol for interfacing web servers with any stand-alone application able to write to the standard output. The web server acts as a gateway: it executes the application corresponding to the called URL and sends its standard output to requesting client (the browser) over the TCP/IP connection. So, thanks to CGI, every language capable of writing to the standard output, even bash scripts, could generate dynamic web pages (not only HTML pages, but also images, style files, etc.). As you can see, differently from current languages and environments for the web (PHP, ASP.NET, JSP, etc.), the programmer have to do a hard work: he has to generate the header of the HTTP answer and, in the case of a HTML page, to compile every tag.

The CGI approach to dynamic web pages has other disadvantages: some performance problems, a difficult access to HTTP’s parameters (GET/POST parameters, cookies and other header’s parameters) and the lack of a communication mechanism between application instances. FastCGI protocol try to overcome these limits.

Nessun commento:

Posta un commento