FrankenPHP, OPcache JIT &amp; Preloading for Laravel | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    FrankenPHP, OPcache JIT, and Preloading: Squeezing Real Throughput from Laravel        On this page       1. [  FrankenPHP, OPcache JIT, and Preloading for Laravel ](#frankenphp-opcache-jit-and-preloading-for-laravel)
2. [  Worker Mode vs. Traditional Mode ](#worker-mode-vs-traditional-mode)
3. [  OPcache Preloading ](#opcache-preloading)
4. [  Choosing the Right JIT Mode ](#choosing-the-right-jit-mode)
5. [  Caddyfile Configuration ](#caddyfile-configuration)
6. [  Practical Takeaways ](#practical-takeaways)

  ![FrankenPHP, OPcache JIT, and Preloading: Squeezing Real Throughput from Laravel](https://cdn.msaied.com/361/fc51b795acf24849e543d4f941b850a2.png)

  #laravel   #frankenphp   #php   #performance   #opcache  

 FrankenPHP, OPcache JIT, and Preloading: Squeezing Real Throughput from Laravel 
=================================================================================

     4 Jul 2026      1 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   FrankenPHP, OPcache JIT, and Preloading for Laravel  ](#frankenphp-opcache-jit-and-preloading-for-laravel)
2. [  02   Worker Mode vs. Traditional Mode  ](#worker-mode-vs-traditional-mode)
3. [  03   OPcache Preloading  ](#opcache-preloading)
4. [  04   Choosing the Right JIT Mode  ](#choosing-the-right-jit-mode)
5. [  05   Caddyfile Configuration  ](#caddyfile-configuration)
6. [  06   Practical Takeaways  ](#practical-takeaways)

 FrankenPHP, OPcache JIT, and Preloading for Laravel
---------------------------------------------------

FrankenPHP is not just a novelty — it embeds PHP directly into a Caddy-based server and exposes a **worker mode** that keeps your Laravel application bootstrapped between requests, similar to Octane but without a separate process manager. Pair that with a well-tuned OPcache preload script and the right JIT mode and you have a meaningful throughput story without exotic infrastructure.

This article is about the specific, practical configuration decisions that matter — not a feature tour.

---

Worker Mode vs. Traditional Mode
--------------------------------

In traditional mode FrankenPHP behaves like php-fpm: each request boots the framework from scratch. Worker mode changes this fundamentally:

```php
// frankenphp-worker.php (placed at project root)
