Save in Sessions to reduce database load
Posted
by
Kovu
on Stack Overflow
See other posts from Stack Overflow
or by Kovu
Published on 2013-10-26T09:50:54Z
Indexed on
2013/10/26
9:53 UTC
Read the original article
Hit count: 246
at the moment I try to reduce the load on my database extremly, so I had a look in my website and think about - what database calls can I try to avoid.
So is there a rule for that? Sould I save every information in a Session that is nearly never changed?
e.g.: The User-Table is a 35-coloumn-table which I need so often in so different ways, that in the moment I got this user-object at nearly every PageLoad AND in the master-site-page-load (Settings, display the username for a welcome message, colors etc etc.). So is that good to avoid the database query here, save the User-Object in a Session and call it from the session - and of course destroy the session whereever the User-Object get changed (e.g. User change his settings)?
© Stack Overflow or respective owner