View Single Post
07-18-2010, 08:48 PM   #1
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
What is opcode caching?

When a PHP script is called by a users browser the process is as folllows:
  1. User requests page
  2. Web server compiles the PHP script (interprets)
  3. Executes the compiled version of the page
  4. Outputs the data
When we think of normal applications such as programs on your desktop, the compiling step is not one we normally consider. Usually the applications we use are already compiled. However, scripting languages such as PHP, Perl, Ruby, etc., are compiled on demand or interpreted. There are subtle differences between compiling and interpreting but that is for another day.

As you can imagine, converting source code to machine code (opcode) can be resource intensive. Opcode caches will store the opcode in a cache and execute it instead of constantly recompiling the source code. This basically eliminates step 2 in the above list and seriously speeds up your site.

There are many opcode caches out there such as Xcache, APC, etc.. No large site should be without one!
Jeff is offline   Reply With Quote