PHP Cache Engines
This article will explain all the available cache engines for php. PHP Cache engines are used to implement cache mechanism for the dynamic sites developed using scripting and programming languages. Cache mechanism will help to increase site performance.
CakePHP/PHP comes with several cache engines built-in, and provides an easy system to implement our own caching systems. The built-in caching engines are:
- File cache is a simple cache that uses local files.
- Not quite fast and doesn’t provide as many features for atomic operations
- Concurrent access are not great at all, if several processes try to read/write at the same time
- since disk storage is often quite cheap, storing large objects, or elements that are infrequently written work well in files
- APC cache uses the PHP APC extension.
- Really fast
- Able to provide atomic read/write features
- But you have less space
- Uses shared memory on the webserver to store objects and it’s local to each server too
- Wincache uses the Wincache extension.
- Wincache is similar to APC in features and performance, but optimized for Windows and IIS.
- Xcache is a PHP extension that provides similar features to APC.
- Uses the Memcache extension.
- Provides a very fast cache system
- Can be distributed across many servers, and provides atomic operations
- Uses the Memcached extension.
- It also interfaces with memcache but provides better performance.
- Quite fast (a bit less than APC ; but still pretty fast)
- Shared between all your servers : each item has to be cached only once, even if you have several webservers.
- You can have several servers in your memcached cluster (which means virtually no limit in the size of the cache)
- Uses the phpredis extension.
- Redis provides a fast and persistent cache system similar to memcached
- also provides atomic operations
Read more about Memcache here