Update APC and APCu

The maintained APCu extension is the previous APC extension without
opcode caching. APC is as of this writing unmaintained.
This commit is contained in:
Peter Kokot
2023-01-16 19:27:13 +01:00
parent 21994a8918
commit f505e08040
2 changed files with 4 additions and 6 deletions

View File

@@ -33,22 +33,22 @@ Example logic using APCu:
{% highlight php %}
<?php
// check if there is data saved as 'expensive_data' in cache
$data = apc_fetch('expensive_data');
$data = apcu_fetch('expensive_data');
if ($data === false) {
// data is not in cache; save result of expensive call for later use
apc_add('expensive_data', $data = get_expensive_data());
apcu_add('expensive_data', $data = get_expensive_data());
}
print_r($data);
{% endhighlight %}
Note that prior to PHP 5.5, APC provides both an object cache and a bytecode cache. APCu is a project to bring APC's
Note that prior to PHP 5.5, there was APC extension which provided both an object cache and a bytecode cache. The new APCu is a project to bring APC's
object cache to PHP 5.5+, since PHP now has a built-in bytecode cache (OPcache).
### Learn more about popular object caching systems:
* [APCu](https://github.com/krakjoe/apcu)
* [APC Functions](https://secure.php.net/ref.apc)
* [APCu Documentation](https://www.php.net/apcu)
* [Memcached](https://memcached.org/)
* [Redis](https://redis.io/)
* [WinCache Functions](https://secure.php.net/ref.wincache)