Ok, another interesting technique question. I'm fetching a number from a database dozens of times a second, from many different pages (i.e. different PHP requests). How can I cache the results of the db query from PHP call to PHP call, to improve speed, someplace in memory or a disk file?
The value I'm fetching won't change more than once a day, and I can manually "reset" it when it's changed.
I thought about storing it in a static text file but I can't imagine that's much faster than a db read every time through (though, maybe the local filesystem would cache it for me?).... or I could define() it, but those get lost at the end of a PHP run, like all variables.
Any ideas?
thanks
Eric