Minimise Zend framework routes
I have routes defined for each module in my application, not heaps perhaps 10 for each module. I have also set up caching of these routes so that the ini files are only parsed once, then stored into a cache fil开发者_运维问答e as an array of Zend_Config_Ini objects. This file comes at 100kB. This file is then read each time the bootstrap is parsed (so every request) and the routes are added to the router.
I'd like to cut the time taken parsing these routes, but am I trying to over optimize here? Or am I missing something in the router with better caching system? (I currently just use the Cache core file).
On a side note, locally my app loads instantly but when live it takes a few seconds thinking about something. Other sites on the server are quicker, how can I find out what is slowing it down?
This is a huge topic. Lots of research needed.
Do you have any metrics on where your app is having performance problems? I doubt parsing the ini file is the issue. Some basics to follow, in no particular order:
- Cache Zend_Db metadata: http://framework.zend.com/manual/en/performance.database.html
- Follow the Zend docs performance tips: http://framework.zend.com/manual/1.10/en/performance.html
- Read Padraic Brady's free online book: http://survivethedeepend.com/ He has a section on performance, but tips are spread throughout the book
- Are you using .htaccess? http://www.armando.ws/2009/03/how-to-run-zend-framework-with-no-htaccess-file/
- Do you use Xdebug? http://giorgiosironi.blogspot.com/2009/10/optimizing-php-application-in-5-minutes.html
- Opcode Cache? http://www.php.net/apc/
精彩评论