使用PHP APC的用户和系统缓存之间的区别

时间:2009-12-27 05:44:39

标签: php apc

apc_clear_cache有一个选项可以发送'user'来删除apc用户缓存,否则就是系统缓存。

我不明白其中的区别,因为无法通过apc_store / apc_fetch将值重新显示在另一个缓存中。

1 个答案:

答案 0 :(得分:6)

它们是不同的缓存。一个并不比其他人好。你可以找到 system cache由缓存文件(PHP字节码缓存)组成。例如,此调用将创建系统缓存:

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

另一方面,用户缓存是程序数据

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

在某些情况下,它可能是time consuming to call apc_clear_cache,您可能最好不要重新启动服务器而不是清除缓存。