Need advice: Effenciency, Sesions variables and databases
Posted: Sun Oct 26, 2008 6:29 am
Hey all,
Well I finally found a good php forum wooohoo, I hope you can give me a little feedback on an idea that I have.
I'm looking for an effecient way to make website menu. At the moment I can bring it back to 1 query per page view
cause I've made an extra database table where the menu is sorted out for me which already was a great improvement
with my very first solution. (Aprox 4 per pageview).
I was wondering if the following is possible. I'm thinking to store the tree at my session variable. In such situation I don't
have to do any query at all. I'll update the tree at the moment that I made a change at my CMS. This solution gives me two problems
1) Is it possible to update a session variable (or a least giving a sign to update tree) in all exisisting sessions from a specific domain?
2) Are there any arguments for not choosing this solution?
Maybe an extra question could be, what is in general good to store at a session variable and what is in general bad to store at session
variable. I'll would like to choose for my solution cause I think the session variable is faster then the database but I'm not sure if it's the
smartest idea to do
All ready thanks for reading
Leon
Well I finally found a good php forum wooohoo, I hope you can give me a little feedback on an idea that I have.
I'm looking for an effecient way to make website menu. At the moment I can bring it back to 1 query per page view
cause I've made an extra database table where the menu is sorted out for me which already was a great improvement
with my very first solution. (Aprox 4 per pageview).
I was wondering if the following is possible. I'm thinking to store the tree at my session variable. In such situation I don't
have to do any query at all. I'll update the tree at the moment that I made a change at my CMS. This solution gives me two problems
1) Is it possible to update a session variable (or a least giving a sign to update tree) in all exisisting sessions from a specific domain?
2) Are there any arguments for not choosing this solution?
Maybe an extra question could be, what is in general good to store at a session variable and what is in general bad to store at session
variable. I'll would like to choose for my solution cause I think the session variable is faster then the database but I'm not sure if it's the
smartest idea to do
All ready thanks for reading
Leon