3 ms·
It strikes me as Unix scripting writ large. * Each page of your site could be a script written in a different language if you wanted. * Environment variables
by frou_dh 10y ago
It strikes me as Unix scripting writ large.
* Each page of your site could be a script written in a different language if you wanted.
* Environment variables (and optionally stdin) arrive to your script representing the request.
* Your script writes the response (HTTP headers and page content) to stdout then exits.
Security/perf pitfalls aside, I still think it's a nice model. It really emphasises the statelessness of HTTP since a pristine new process is booted up to handle each request.
- mperham 10y agoMy business is built on CGI scripts for processing automated webhooks. There's several non-trivial benefits: 1. Nothing running 24/7. No services to monitor, very light on memory. 2. Immune to memory leaks and bloat. Guaranteed fresh state on every request. It's not ideal for user-facing functionality but has proven extremely reliable and maint-free. My goal was to use something that would require no recurring maintenance, unlike all modern web tech. All that is running 24/7 is Apache.
- lacampbell 10y agoThat's pretty cool to hear actually. CGI or FastCGI?