使 Zend-Framework 运行得更快
除了 Zend Optimizer 之外,还有哪些使 Zend-Framwork 运行得更快的最佳方法?
如果我没记错的话,在 PHP 中解析 .ini 文件需要很长时间。因此我缓存它(文件在请求期间不会改变)
还有其他方法可以提高ZF的性能吗?
What are the best ways to make Zend-Framwork run faster besides Zend Optimizer?
If I remember correctly, parsing .ini files in PHP takes a long time. Therefor I cache it (the file won't change during a request)
Are there any other ways to improve ZF's performance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我缓存我的 application.ini 像这样:
确保您有以下目录(您的缓存目录):
/application/data/cache
我用
My_Application 扩展
,参见代码:Zend_Application
我将我的index.php(在
public
根目录中)更改为:重新加载页面,您会看到缓存的ini文件。祝你好运。
I cache my application.ini Like this:
Make sure you have the following directory (your cache dir):
/application/data/cache
I extend
Zend_Application
withMy_Application
, see code:And I change my index.php (in the
public
root) to:Reload the page and you see the ini file cached. Good luck.
解析 .ini 文件可能有点慢,但我不认为这会是典型 ZF 应用程序中最慢的部分。如果没有看到任何结果,似乎包含一堆文件(Zend_Cache_*)在某些情况下可能比解析一个简单的 .ini 文件还要慢。无论如何,这只是一个领域......
采埃孚发布了一份很好的优化指南:
http://framework.zend.com/manual/en/performance.classloading.html
简而言之,
如果您想了解更多,
Parsing .ini files may be a little slow, but I wouldn't expect that to be anywhere near the slowest part of a typical ZF application. Without seeing any results, it seems like including a bunch of files (Zend_Cache_*) may in some cases be even slower than parsing a simple .ini file. Anyway, that's just one area...
ZF has published a good guide on optimization:
http://framework.zend.com/manual/en/performance.classloading.html
In short,
If you want to get a bit more into it,
另请参见 http://www.kimbs。 cn/2009/06/caching-application-ini-for-zend-framework-apps/
see also http://www.kimbs.cn/2009/06/caching-application-ini-for-zend-framework-apps/
你为什么删除了最后一个问题?
我有一个很好的链接给你:
Why did you deleted your last question?
I had a good link for you: