lighttpd 最好的缓存模块是什么?
我正在使用 lighttpd Web 服务器,现在我必须安装 wordpress 来运行我的博客。
我非常关心缓存。我知道有一个很好的 php 模块,名为 XCACHE,但我不明白是否必须安装此模块或只安装“超级缓存”wordpress 插件。
有什么区别?可以一起跑吗?
谢谢你!
I'm using lighttpd web server and now I have to install wordpress to run my blog.
I am very concerned about caching. I know there is a good module for php named XCACHE but I don't understand if I have to install this module or only install "super cache" wordpress plugin.
What are the differences? Can run together?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Xcache 是一个操作码缓存。 PHP 每次运行时都会进行编译。因此,Xcache 会以机器语言缓存其代码并将其存储在 RAM 中。这极大地加快了脚本的执行速度,因为它不需要重新编译,而且它存储在 RAM 中(更少的 I/O)。然而,这意味着您的所有页面仍然是动态的,这意味着您的页面每次都会通过执行 php 代码来生成。
如果你安装了超级缓存插件,就会缓存页面的html。它将存储 html,然后将其提供给用户。这意味着数据在缓存时间内是静态的,而不是为每个用户动态生成的。
最好同时使用两者以获得最大性能结果。但是您需要在服务器上安装 Xcache 才能在 WordPress 中使用 Xcache 插件。
Xcache is an opcode cache. PHP compiles every time it is run. So Xcache would cache its code in the machine language and store it in RAM. This is greatly speed up execution of the script as it doesn't need recompiling and also it is stored in RAM (less i/o). However, this means that all your pages would be still dynamic, which means that your pages would be generated everytime by executing the php code on there.
If you install super cache plugin, that will cache the html of the page. It will store the html and then serve that to the user. This means that the data would be static for the caching time and not dynamically generated for every user.
It would be best to use both for the maximum performance results. But you would need Xcache installed on your server to be able to use the Xcache plugin in wordpress.