2009年4月26日星期日

Re: [fw-mvc] Performance boost for ajax request?


And, sadly, it seems to be the only way right now. Creating a separate work-flow without touching Zend's MVC & Action Controller.

Maybe there should be Zend's standard recommendations on how to re-use Zend's components, which are likely to be Zend_Db and some "assisting" modules like Config, Session, Translate...
Zend_Dispatcher or Zend_Controller should be avoided. Zend_View can be handy sometimes when you need to return some HTML, not just JSON...

Oh well, I'd better stop. I guess I'm doomed trying to create this thing :D



Writing an Action Controller means that you want to take advantages of Zend MVC architecture which gives you a well-defined workflow but with some overheads. Anything that hits dispatcher is expensive.

So I think it should be better to stay away from it for several light weight and performance-sensitive tasks. Tweak your .htaccess to add some free standing scripts which should not prevent you from using some selective components in Zend Framework. The problem is that you have another workflow to manage.

On Fri, Apr 24, 2009 at 11:20 AM, Van H Tran <tvhoang1980@yahoo.com> wrote:
Hello everybody,
Sometimes there are requests that are simple ajax request (for example, get a district list of a city), that does not need to go through all the bootstrap and heavy stuff from Zend. Only a few Zend components such as : Zend_Session, Zend_Db then are needed.

What is the best way to write the Action Controller for those requests? I haven't found Zend's support for that? Or am i missing something?

Thanks



--
--------------
http://groups.google.com/group/phpvietnam

没有评论: