frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Finish request early: frankenphp_finish_request

Open withinboredom opened this issue 2 years ago • 6 comments

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

withinboredom avatar Oct 26 '22 13:10 withinboredom

Is the fastcgi_finish_request alias really needed? What does it bring?

chalasr avatar Oct 31 '22 22:10 chalasr

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.

withinboredom avatar Oct 31 '22 22:10 withinboredom

Other SAPIs don't have such alias though (or even removed it for some reason)

chalasr avatar Oct 31 '22 22:10 chalasr

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.

dunglas avatar Nov 01 '22 00:11 dunglas

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.

dunglas avatar Nov 01 '22 00:11 dunglas

Makes sense. Thank you guys for the explanations

chalasr avatar Nov 01 '22 01:11 chalasr

🎉

withinboredom avatar Nov 03 '22 21:11 withinboredom