4 ms·
> Also, sharing resources between connections is (at best) very difficult using CGI, and its trivially easy using a stand-alone app server. You can just set up
by rakoo 4y ago
> Also, sharing resources between connections is (at best) very difficult using CGI, and its trivially easy using a stand-alone app server. You can just set up a global variable at process startup and you're done
You can pass environment variables to CGI scripts as well. In fact, that's exactly how CGI works. Shared resources can be cached in memory through redis, although a shared file (for example sqlite) is enough in many cases.
> I don't need Apache + fastCGI + php + php fastCGI + apache configuration to get started
I'm talking about CGI, not fastCGI
- josephg 4y agoEnvironment variables can’t store a TCP connection to a database or a pre rendered HTML string. In the latter case you could use redis, but that’s a poor, inconvenient, inefficient replacement for a global variable.
- rakoo 4y agoAgain, I'm not saying CGI is the fastest but that it is fast enough. Opening a new connection (or better yet, using SQLite), reading a file that contains a prerendered HTML string are fast enough for most use cases