apc_compile_file() 是否会使特定文件的内存缓存失效?

发布于 2024-08-16 23:53:30 字数 339 浏览 8 评论 0原文

如果我运行以下 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

∞梦里开花 2024-08-23 23:53:30

是的,如果文件已经自动缓存, 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文