Re: [need for advices] fastCaching
| From: | MARTY Fabien | Date: | Mon, 22 Jul 2002 14:41:56 +0000 |
| Subject: | Re: [need for advices] fastCaching | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7854@lists.php.net to get a copy of this message | ||
(Tomas)
> Hehe, but this is not the minimal layer I was thinking. This way you end
> up including: file.php, Container.php, Error.php and PEAR.php. My idea
> was more that way:
>
> Class_isCached {
> function isCached($container, $opts) {
>
> }
> function _isCachedFile($id) {
> //code from Cache_Container_file here
> }
> function _isCachedDB() {}
> }
> Just one file to include.
In my bench, I didn't include Container.php but PEAR.php and Error.php
was included by Cache.php
But what about reading the cache ? In most cases, there is a not expired
cached file. So we have to read it too.
But I think I don't undestand well where you want to go. When you call
"require_once 'Cache.php'", PEAR.php is automaticaly included because
Cache extends it. And Error.php too.
When the Cache constructor is called, the choosen container is included.
My minimalist container was exactly :
<?php
class Cache_Container_file {
function isCached() {
return true;
}
function isExpired() {
return false;
}
function load() {
return '123';
}
}
?>
So, it doesn't include Container.php at all.
Hum...
So your class won't be faster ???
I have a problem somewhere... Maybe your class is a frontend and you
don't use "require 'Cache.php'" at all ??? But, if we do that, we will
have to write a big monolytic class with all containers inside ! Beuhh
!!!
So, I don't understand ! Tomas, give me your light please ! ;-)
Fabien