Save in Sessions to reduce database load
- by Kovu
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)?