apc_compile_file() 是否会使特定文件的内存缓存失效?
如果我运行以下 PHP 代码:
apc_compile_file("relative/path/to/file");
它会使用于该特定文件的内存缓存失效吗?
也就是说,如果我第一次访问/path/to/file,APC将编译它,并将OpCode缓存在内存中。现在,如果我再次访问 /path/to/file,APC 将仅使用缓存的 OpCode。但是,如果我修改此文件并将 apc.stat 设置为 0(关闭),它将使用内存中的操作码,尽管文件已修改(因为 apc.stat 已关闭)。我的问题是,如果我在更新文件后运行 apc_compile_file() ,内存缓存会更新吗?
If I run the following PHP code:
apc_compile_file("relative/path/to/file");
will it invalidate the in-memory cache that is used for this particular file?
That is, if I first access /path/to/file, APC will compile it, and cache the OpCode in memory. Now, if I access /path/to/file again, APC will just use the cached OpCode. However, if I modify this file and apc.stat is set to 0 (off), it will use the OpCode from the memory, although the file was modified (because apc.stat was off). My question is that if I run apc_compile_file() for the file after updating it, will the memory cache get updated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,如果文件已经自动缓存, apc_compile_file() 将强制 APC 更新其缓存。
检查此错误报告:
http://pecl.php.net/bugs/bug .php?id=11857
Yes, apc_compile_file() will force APC to update its cache if the file has already been cached automatically.
Check this bug report:
http://pecl.php.net/bugs/bug.php?id=11857