On 03/10/2003 01:30 PM, Mike Mannakee wrote:
I have some sets of values that I have stored in several tables in a mySQL database. These don't often change, but are referenced on every single page view. While each call is quick, as a gross the load on the server is too high. I would like to know if there is a way to have these sets of values remain persistent in the server's memory between calls from browsers, like environment variables, to reduce the back and forth calls to mySQL. As the data from the calls are almost always the same, it would seem easier this way.
Any thoughts? Comments? RTFM suggestions?
You may want to try this cache class. You can take any variable and serialize it so it can be stored for later retrieval without querying your database.
http://www.phpclasses.org/filecacheclass
Usually I do not recommend caching just variables. For instance, if your variables will be used to generate portions of HTML pages, it would be more efficient to cache those portions of HTML data instead of the variables that is only used to regenerate such HTML data.
--
Regards, Manuel Lemos
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php