views:

249

answers:

1

apc_clear_cache [http://php.net/manual/en/function.apc-clear-cache.php] has an option to send in 'user' which will delete the apc user cache, or else if not present, the system cache.

Which is better? I don't understand the difference since there's no way to explicitly store a value in one cache over the other via apc_store/apc_fetch.

Any thoughts?

+1  A: 

They are different caches. One is not better than others. You can find about The system cache consists of cached files (PHP bytecode cache). For instance this call will create system cache:

$file = "foobar.php";
apc_compile_file($file);

On the other hand, the user cache is program data

$silly_text = "Lorem ipsum dolor sit amet";
apc_store("silly", $silly_text);

In some cases, it may be time consuming to call apc_clear_cache and you may be better off restarting the server instead of clearing the cache.

Chandra Patni
so is that to say system cache is about bytecode caching, where as user cache is about value/data caching/storage?
onassar
Yes. I have hyper linked system cache to http://phpbuilder.com/manual/en/function.apc-cache-info.php URL which also mentions system cache consists of cached files. In general you should think of this as the area used by system level components like APC and PHP runtime.
Chandra Patni