What is the scheme of browser-server communication when server application realizes FastCGI 1.0?
1 Answers
There is nothing different. The web browser sends http(s) requests to the server, and the server sends the response back. There is nothing different for the browser, actually the browser has not even a way to know, what is communicating to it: a simple CGI, a fastcgi application or some entirely different (like various ruby or java frameworks).
The difference between the CGI and the FastCGI does not lie here. The difference is, how the http server communicates with the CGI/FastCGI app.
In the case of a the CGI, the webserver starts a process for the request, gives the request to it, and then sends the response back to the browser. After that, the CGI process is over, done, ready. To serve a new request, a new process has to be started.
It is easier to develop, but it has a huge overhead for anything more complex. The whole initialization has to be re-run for all the requests.
In FastCGI, the webserver can serve multiple resquests to the same CGI script. This requires a more complex communication between the process and the webserver: the webserver has to be able not only to start and stop them, but also to explain to them, when is a new request coming and when is coming the last.
- 2,553
- 10
- 31
- 49