我应该在开发环境中使用PHP加速器(eAccelerator、APC等)吗?
我认为这个问题本身就说明了问题。
我担心的是,我们会到处修改一些 PHP 文件。加速器是否知道它需要重新编译修改后的文件(我认为他们会,常识)?
但是,我没有找到任何关于此事的文档。
也就是说,它会帮助(加速)在开发环境(例如本地主机)上安装 PHP 加速器吗?
I think the question speaks for itself..
My concern is, we would be modifying some PHP files here and there. Will the accelerator(s) know that it needs to recompile modified files (i assume they would, common sense)?
However, i didnt find any documentation on this matter.
That said, would it help (speed up) installing PHP accelerators on development environment (say localhost)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
除非您正在调试缓存器,否则应在开发时关闭缓存。
Unless you are debugging your cacher, caching should be turned off for development.
除非您想对您的开发环境进行基准测试,否则我会简单地将其称为不成熟的优化。
大多数缓存器都会检查更新的文件,但您可能会在缓存文件时浪费时间等。
将开发留给灵活性并消除缓存的任何问题。至少我会这么做。
Unless you want to benchmark on your development environment I would simply call this pre-mature optimization.
Most of the cachers do check for updated files, but you might be wasting time while the files are cached, etc.
Leave development for flexibility and eliminate any problems with caching. That is at least what I would do.
加速器确实会检查文件是否已被修改(嗯,我唯一有过使用经验的是 APC,但我怀疑其他加速器也会类似),因此在开发环境中使用加速器应该不会有任何问题(尽管获得的好处将是最小的,因为如果文件不断更改,加速器将不得不不断地重新读取所有代码)。
The accelerators do check if files have been modified (well, the only one I have experience with is APC, but I suspect the others will be similar), so you shouldn't have any problems using an accelerator in a development environment (although the benefit gained will be minimal, since if files are being constantly changed the accelerator will have to constantly re-read all the code).