From: Jason S. <jsw...@ya...> - 2003-01-08 02:20:29
|
-- Arnold Cano <arn...@ya...> wrote: > 3. The current design is not as efficient as it could > be because every request into the controller results > in an additional request via HTTP redirect via a call > to the PHP header() method (thanks Ross Keatinge). I > modified a local copy of Phrame to output the view > directly as part of the original HTTP request. This > change resulted in a new ActionView class that > contained a display() method. From an Action's > perform() method I would return an ActionView object > to the ActionController. Then in the index.php file I > would get a reference to the ActionView object from > the ActionController and call it's display() method. > This change shouldn't affect Phrame's ability to use > various display technologies such as Smarty, XSLT, > Flash, etc. I disagree with the idea of removing the redirection from the architecture because it serves a very useful purpose, one that, IMHO, far outweighs any performance considerations. The redirection after a POST request forces the user's browser to issue a GET request for the view page. This has the effect of correcting a major problem with users hitting the refresh button on the next page, forcing the browser to re-submit the POST request. Most users are just hitting refresh to make sure they are seeing the latest data on the view page, and are confused when the browser asks them if they want to re-post the information. Most consider this an application error rather than a user error :) Redirection happily takes care of this situation, the user hitting refresh will submit a GET request for the view page as they most likely intended in the first place. Performance wise, it is not as if you are fetching and rendering the whole page twice, the header is a single packet traveling to the browser asking it to issue a GET request. There is one additional round trip between the server and the browser for this, but it should not be a significant enough problem to eliminate the benefit of redirection described above. Regards, Jason __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |