Cache Using APC Cache

suggest change

The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

installation

sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart

Add Cache:

apc_add ($key, $value , $ttl);
$key = unique cache key
$value = cache value
$ttl = Time To Live;

Delete Cache:

apc_delete($key);

Set Cache Example:

if (apc_exists($key)) {
    echo "Key exists: ";
    echo apc_fetch($key);
} else {
    echo "Key does not exist";
    apc_add ($key, $value , $ttl);
}

Performance:

APC is nearly 5 times faster than Memcached.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Cache:
* Cache
* Cache Using APC Cache

Table Of Contents
2 Arrays
4 Types
10 Cookies
14 JSON
15 SOAP
17 cURL
19 XML
21 Traits
35 UTF-8
36 URLs
38 PHPDoc
41 Loops
44 Closur
72 YAML
77 Cache
78 Streams
81 PDO
82 SQLite3
83 Sockets
87 MongoDB
93 IMAP
94 Redis
95 Imagick
102 APCu
108 PSR