FrankenPHP, OPcache JIT &amp; Preloading for Laravel | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://msaied.com) - [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [About](https://msaied.com#about)

           [  Contact](https://msaied.com#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://msaied.com)
- [ProjectsCase studies](https://msaied.com/projects)
- [ArticlesEngineering notes](https://msaied.com/articles)
- [CertificatesCredentials](https://msaied.com/certificates)
- [AboutHow I work](https://msaied.com#about)
- [ContactGet in touch](https://msaied.com#contact)

  [Start a conversation](https://msaied.com#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://msaied.com)
2. /
3. [Articles](https://msaied.com/articles)
4. /
5. FrankenPHP, OPcache JIT, and Preloading: Squeezing Real Throughput from Laravel

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

 A practical guide to running Laravel under FrankenPHP with OPcache JIT and preloading enabled — covering worker mode, preload scripts, JIT tracing vs function modes, and the gotchas that bite in production.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://msaied.com#person) Published 4 Jul 2026 · Updated 4 Jul 2026 · 1 min read

ShareCopy linkCopied

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

  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 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)
