3 ms·
By the time webdev was even on my radar, the only things I "knew" about CGI was that it was old and bad. Or something.
by lacampbell 9y ago
By the time webdev was even on my radar, the only things I "knew" about CGI was that it was old and bad. Or something.
- frou_dh 9y agoIt 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 9y 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 9y agoThat's pretty cool to hear actually. CGI or FastCGI?
- saghm 9y agoRight, but for an aspiring web programmer, it's a great learning exercise. By hiding all of the magic, it makes it much easier to understand what's actually going on and fully "get" web programming.