frankenphp
frankenphp copied to clipboard
Finish request early: frankenphp_finish_request
This adds a new function: frankenphp_finish_request
and an alias for it: fastcgi_finish_request
, which follows in the footsteps of other SAPIs.
closes #62
Is the fastcgi_finish_request
alias really needed? What does it bring?
Is the fastcgi_finish_request alias really needed? What does it bring?
Mostly it brings compatibility with other scripts/libraries without needing to make specific changes just to support frankenphp.
Other SAPIs don't have such alias though (or even removed it for some reason)
NGINX Unit implements this function (with no alias): https://github.com/nginx/unit/blob/master/src/nxt_php_sapi.c#L216
Having it will improve the performance of the hundreds of applications out there relying on this feature.
And according to https://github.com/nginx/unit/issues?q=is%3Aissue+fastcgi_finish_request (no bug report since this feature has been implemented), it's quite safe to do as long as this function behaves exactly as the original one (which should be the case here).
Also, if someone really wants to exclude FrankenPHP, it's quite easy to do using feature/SAPI detection.
Makes sense. Thank you guys for the explanations
🎉