FastCGI script is a network server that listens for connections in a loop. The web server sends requests to the FCGI server, which sends back dynamically generated content - across the socket connection. Thus, the FCGI script is faster than the CGI, as it is not re-created for every request.
, 100 100 . script 100 . FCGI , . ( , ).
100 , 100 if. :
hash_table page_generators;
page_generators["login_page"] = handle_login_page_fn;
page_generators["contact_page"] = handle_contact_page_fn;
page_type = request.get("page_type");
fn = page_generators[page_type];
if (fn == NULL)
return "<html><body>Invalid request</body></html>";
else
return fn(request);