Caching Classes
Moderator: General Moderators
-
programmermatt
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 15, 2005 5:03 pm
- Contact:
Caching Classes
I am participating in a rather large project and am trying to find ways to optimize the scripts. My question is wether it would be smart to set up a server side caching system for classes such as our authentication, permission and user class instead of recreating them every page load (as they use a good amount of queries and logical structures that must recursively process data on creation) ? If so, would it be better to cache via file, DB or something like $_SESSION? How far would such caching be safe and should short or longer expirey times be set? Assuming that there is no way for the wrong cached item to go to the wrong user.
I cache classes in sessions all the time:
Code: Select all
$ClassObj= new MyClassIsCoolerThenYourClass($data);
$_SESSION['ClassObj'] = &$ClassObj;
$_SESSION['ClassObj']->getData();-
programmermatt
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 15, 2005 5:03 pm
- Contact: