DarkGhostHunter/Preloader

What is the point of regenerating the preload file every X requests if a server restart is required for it to take effect?

Closed this issue · 1 comments

From the manual (emphasis mine):

preload.php is an arbitrary file that will run once at server startup (PHP-FPM, mod_php, etc.)

Unless your code triggers an FPM restart when that preload file is updated (which is quite crooked) then the idea of "we'll generate a preload file that is most optimized based on the current requirements of your application" is impossible. Not only that, you also have to start with a preload file when enabling this feature but you don't even get one until you reach X amount of requests.

Is there something I'm missing or has this been overlooked by the author?

From the manual (emphasis mine):

preload.php is an arbitrary file that will run once at server startup (PHP-FPM, mod_php, etc.)

Unless your code triggers an FPM restart when that preload file is updated (which is quite crooked) then the idea of "we'll generate a preload file that is most optimized based on the current requirements of your application" is impossible. Not only that, you also have to start with a preload file when enabling this feature but you don't even get one until you reach X amount of requests.

Is there something I'm missing or has this been overlooked by the author?

I'll make a clarification for that, in case someone forgets to RTFM on Opcache.

Once the script is generated, you're encouraged to restart your server to pick up the generated preload script.