Re: persistent storage in PHP

From: Date: Thu, 08 May 2003 00:34:08 +0000
Subject: Re: persistent storage in PHP
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-146765@lists.php.net to get a copy of this message
stuff the data into a file and include() it in every page. =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * ----- Original Message ----- From: "Greg Stark" <greg-spare-1@mit.edu> To: <php-general@lists.php.net> Sent: Wednesday, May 07, 2003 5:47 PM Subject: Re: [PHP] persistent storage in PHP > 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. > > Woah, I guess my question was ambiguous. I'm not talking about data persisting > from one page access to the next for a given user. I'm talking about data > persisting from one user to the next for a given web server process. > > I'm talking about data that will be inserted into the template for every > single page access, so I don't want to add an extra database call. And data > that changes very infrequently, actually probably never once the site goes > live. > > The solution we always used with mod_perl was just to declare a static hash > and do lazy memoizing of any values looked up in the database by stuffing them > in the hash. The next page access for the next user would check the hash first > before checking the database. When the values in the database changed the > values on the web site wouldn't update until the processes exited and new > processes were forked, which would take 10-15 minutes. > > -- > greg > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#146765) next »