On Dec 14, 2007, at 1:41 PM, David Krings wrote:
John Campbell wrote:
Is there anything drastically flawed with my approach?
Since you understand the pitfalls of your approach and choose to do
it
that way it is not a problem. You are also using sessions to prevent
repeated hits to the database for "performance reasons". Don't do
that. It typically makes performance worse because session data must
be serialized and written to disk on every request even if the data
doesn't change.
So you are saying that a database access is faster than a file
access? I find that hard to believe, but do not have any evidence of
the contrary.
I would guess it depends on a number of factors -- like whether or not
the session file is in the OS filesystem cache, what type of hard
drive you are using, etc. I think the point John was making is that
if the data doesn't change you might be able to recognize that there
was no change and not write the session data at the end of the
request. With php's default session handler, it's going to write to
the session file at the end of every request. If you're not working
on a medium to high volume traffic site, the performance difference
probably isn't a big deal.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php