mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-17 19:16:20 +02:00
added caching section, added bytecode caching sub-section
This commit is contained in:
3
_posts/10-01-01-Caching.md
Normal file
3
_posts/10-01-01-Caching.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Caching
|
||||
|
||||
PHP applications on their own are relatively slow, but thankfully there's various (easy) ways to speed things up by using caching on various levels.
|
17
_posts/10-02-01-Bytecode-Cache.md
Normal file
17
_posts/10-02-01-Bytecode-Cache.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
isChild: true
|
||||
---
|
||||
|
||||
## Bytecode Cache
|
||||
|
||||
When PHP file is executed, under the hood it is first compiled to bytecode (also known as opcode) and only then, the bytecode is executed.
|
||||
If PHP file is not modified, then bytecode will always be same, which means that compilation step is a waste of CPU resources.
|
||||
|
||||
This is where Bytecode cache comes in - it prevents redundant compilation by storing bytecode in memory and reusing it on successive calls.
|
||||
Setting up bytecode cache is a matter of minutes and your application will speed up significantly, there's really no reason not to use it.
|
||||
|
||||
Popular bytecodes caches are:
|
||||
|
||||
[APC](http://php.net/manual/en/book.apc.php)
|
||||
[xCache](http://xcache.lighttpd.net/)
|
||||
[Zend Optimizer+](http://www.zend.com/products/server/) (part of Zend Server package)
|
Reference in New Issue
Block a user