Photo by Nicole Wolf on Unsplash

Member-only story

OPcache and Preloading in PHP

Atakan Demircioğlu
Jotform Tech
Published in
3 min readSep 21, 2023

This is the second part of my blog series on PHP. In this post, we will cover OPcache and preloading.

Before starting this article, I recommend first reading “The Magic Behind PHP” for a better understanding of how PHP works.

What is OPcache?

In the left part (not cached) PHP’s internal working style is applied. We can see from this figure that the default (not optimized) PHP has a real bottleneck. For the same script, we are tokenizing, parsing, and compiling again and again. So this is not a good thing.

As developers, we can solve similar problems by applying cache strategies. So PHP developers did the same thing and introduced OPcache. with PHP 5.5. Before PHP supports internally there were several solutions and extensions for this problem. For example, APC, eAccelerator, and XCache.

After the compilation step, we store precompiled bytecodes in Shared Memory, and in the upcoming requests, PHP skips the parsing and compilation steps. This basically means “speed” :)

What is preloading?

Published in Jotform Tech

Welcome to Jotform official tech blog. Read about software engineering and how Jotform engineers build the easiest form builder.

Written by Atakan Demircioğlu

Passionate about blogging and sharing insights on tech, web development, and beyond. Join me on this digital journey! 🚀

No responses yet

What are your thoughts?