Re: Cache

From: Date: Mon, 16 Aug 2004 15:14:44 +0000
Subject: Re: Cache
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193949@lists.php.net to get a copy of this message
"Octavian Rasnita" <orasnita@fcc.ro> wrote in message news:003401c483a2$c05086e0$142afea9@microsoft.com... > Hi all, > > I want to create an html cache of a page, like when that page is saved to > the disk and let the visitors download that static page and not a dynamic > one. > Of course, a dynamic PHP program will load that static page and display it, > but without need to connect to databases, to make calculations, etc. > > The problem is that I don't know how to automaticly decide when it is the > right moment to update the cache and this is very important. > I get some data from a database and the PHP program doesn't know when the > database gets updated by another program, so it cannot create the cache for > that page immediately. > If I let the program check the database each time it is ran, this takes some > times, and it is like I would not use the cache at all. > > Is it possible to use that kind of cache I want? (meaning... a kind of > static page saved). > > Thank you. > > Teddy Hi Teddy, take a look at PEAR's Cache_Lite: http://pear.php.net/package/Cache_Lite With this package you define a "lifetime" for each page. When this time has passed a new cached file will automatically be created. Cache_Lite is managing this for you. Regards, Torsten Roehr

« previous php.general (#193949) next »