[nycphp-talk] POSTDATA and back/resubmit revisited
Cliff Hirsch
cliff at pinestream.com
Mon Jun 11 13:57:33 EDT 2007
On 6/11/07 1:32 PM, "Chris Shiflett" <shiflett at php.net> wrote:
> Cliff Hirsch wrote:
>>> 1. Why is there any duplicate processing?
>>
>> A Form submission would start by running the front-end controller,
>> which loads a whole lot of classes, checks authentication,
>> establishes the DB connection, inits sessions, sets up the template
>> controller, and other housekeeping chores.
>
> This sounds like an argument against using a framework. :-)
True. A trivial script becomes a simple dispatcher becomes a front-end
controller becomes a Framework, becomes...before you know it...ASP.NET?!
> Jesting aside, if you accept this overhead for every request, why would
> it suddenly be unacceptable for a request to process a form?
Excellent point.
> You incur this overhead twice, but if adding a request / response
> transaction noticeably degrades the performance of your web site, I
> would speculate that your problems have little to nothing to do with
> whether you use this particular technique.
Good point. I'm sure other bottlenecks will arise long before this.
>>> 2. What is the basis of your concern regarding session overhead?
>>> You can persist data in cookies, if it's really a concern.
>>
>> This probably dates back to a presentation at the Zend conference
>> several years ago given by Joyce from Renkoo regarding the evils of
>> sessions.
>
> She might have been speaking about scalability. As your userbase
> increases, server-side session data stores become increasingly difficult
> to scale, although solutions like memcache make this problem manageable
> for lots of really popular sites.
Exactly. I've been designer for millions of users before I have even one.
Talk about putting the cart before the horse....
> By the way, since writing the article, this technique has been described
> as a design pattern called PRG (POST, Request, GET).
Makes sense -- its all starting to make sense, albeit slowly...
Chris, as always you are a wealth of knowledge.
Thanks,
Cliff
More information about the talk
mailing list