Use auto_globals_jit to make classic mode like worker mode for some use-cases
Describe your feature request
Is your feature request related to a problem? Please describe.
We (myself and @SpencerMalone) were discussing how to use workers to 'bootstrap' an application, then wait for a request, then die() to allow for classical applications to get some performance without having to rewrite them for worker mode.
Describe the solution you'd like
We could maybe specify in the caddyfile:
preheat public/index.php
for a route, then we spawn up some workers that start up the file and once a superglobal is accessed, we pause execution until a request comes through, fill in the superglobals, then continue the script. This requires the use of auto_globals_jit to make work, but older/custom applications will be able to take advantage of performance from frankenphp while implementing worker scripts.
That would lead to problem with things like db connections that aren't properly refreshed from the point of pre-heating to the actual execution of a script.
The use-case here is legitimate of course, but I don't think we should particularly advertise it to the public API.
Interesting idea, but probably very complex to do. _GET, _POST, _COOKIE and _FILES do not have jit enabled, you'd have to do modifications here in php-src.
I've never really understood why only some of the super globals are affected by that option :(
I dont have much to contribute here, but this is a fascinating idea. I really hope that it could be made to work - even if it is limited.