You ship a release. The files on the server are new. The site still behaves like the old version.
What is going on
The recommended production setting is opcache.validate_timestamps=0. PHP then never checks whether a file changed, so it keeps serving the compiled bytecode of the previous release until the process pool restarts.
The obvious fix, resetting OPcache from an Artisan command, does not work. The CLI and the FPM worker pool do not share the same OPcache, so the command resets a cache that your visitors never touch.
The fix
I built Kiln, a small package that adds four commands: kiln:clear, kiln:warm, kiln:status and kiln:config. It also adds an optional HTTP route that runs the clear or the warm inside an actual FPM worker, which is the only place that can reset the cache your site really uses.
- The route only accepts temporary signed URLs and refuses a signature that has no expiry.- Clear and warm are POST-only, so link prefetchers and scanners cannot trigger them.- Warming compiles files with opcache_compile_file(), which does not run their top-level code, and stops after 20 seconds by default.## Install composer require amjadiqbal/kiln It needs PHP 8.3+ and Laravel 12 or 13. Free and MIT licensed. Full docs and the source: https://amjad.com.pk/laravel/packages/kiln