Re[2]: [PHP] persistent storage in PHP

From: Date: Thu, 08 May 2003 06:59:37 +0000
Subject: Re[2]: [PHP] persistent storage in PHP
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-146793@lists.php.net to get a copy of this message
Hi, Thursday, May 8, 2003, 8:47:42 AM, you wrote: GS> wbrown@arkie.net (Wendell Brown) writes: >> On 07 May 2003 18:34:06 -0400, Greg Stark wrote: >> >> >How do I cache data persistently across page calls? As near as I can tell all >> >the variable scopes in PHP terminate at the end of a page and the next page >> >starts with a clean slate. >> >> If you are dealing with forms, you can "store" data in hidden fields. >> Otherwise you might want to look into sessions. GS> Woah, I guess my question was ambiguous. I'm not talking about data persisting GS> from one page access to the next for a given user. I'm talking about data GS> persisting from one user to the next for a given web server process. GS> I'm talking about data that will be inserted into the template for every GS> single page access, so I don't want to add an extra database call. And data GS> that changes very infrequently, actually probably never once the site goes GS> live. GS> The solution we always used with mod_perl was just to declare a static hash GS> and do lazy memoizing of any values looked up in the database by stuffing them GS> in the hash. The next page access for the next user would check the hash first GS> before checking the database. When the values in the database changed the GS> values on the web site wouldn't update until the processes exited and new GS> processes were forked, which would take 10-15 minutes. GS> -- GS> greg msession can do this, not only across different clients but also servers. -- regards, Tom

« previous php.general (#146793) next »