Re: [fastCache] 304
| From: | Olivier Vanhoucke | Date: | Tue, 23 Jul 2002 08:09:00 +0000 |
| Subject: | Re: [fastCache] 304 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7887@lists.php.net to get a copy of this message | ||
It's quite easy to use a HTTP 304. I think something like this could work
(haven't tested)
jpcache system for 304 must be better ...
Olivier
$get = '';
foreach ($_GET as $key => $value) {
$get .= $key.'='.$value.'&';
}
$id_etag = $_SERVER['PHP_SELF'].'?'.$get.' '.date('d/m/Y
H:i:s',
filemtime($_SERVER["SCRIPT_FILENAME"]));
$headers = getallheaders();
if (isset($headers['If-None-Match'])) {
if ($headers['If-None-Match'] == '"'.$id_etag.'"') {
header('HTTP/1.1 304 Not Modified');
exit();
}
}
header('Etag: "'.$id_etag.'"');
header('Refresh: 86400');
----- Original Message -----
From: "MARTY Fabien" <fabien.marty@free.fr>
To: <pear-dev@lists.php.net>
Sent: Tuesday, July 23, 2002 3:14 AM
Subject: [PEAR-DEV] [fastCache] Goals
> To sum up,
>
> PEAR/Cache
> ----------
>
> Good points :
> - Flexibility (Container Approach...)
> - Functionalities (possible to add user data into cache...)
> - A few classes which extend Cache.php (Graphics.php, Function.php...)
> - Block caching
>
> Bad points :
> - Slow (for a cache system (30 requests/s on my old computer))
> - No corruption tests
>
>
> JpCache (stable 1.1.1)
> -------
>
> Good points :
> - Functionalities (When not modified since last visit, sends 304
> response...)
> - Gzip compression if possible
> - Very Very Very Easy to use :-)
> - A DB container (in another separated file)
>
> Bad points :
> - not object oriented
> - Only page caching (not block)
> - Not really flexible
> - No corruption tests
>
> In the middle :
> - Perfs : 80 requests/s
> - End User oriented (exclusively)
>
>
> fastCache (maybe another name ?)
> ---------
> (it's only a projection to freeze goals of the class)
>
> Good points :
> - Perfs (150 requests/s)
> - Secure (file locking + corruption tests (for NFS...))
> - Block Caching
> - Can be used by end users and as a piece of larger scripts
>
> Bad points :
> - only file container (the fastest)
>
> In the middle :
> - we will have to adapt lightly Graphics.php, Function.php... to get a
> compatibility with fastCache
> - caching and only caching (Galeon : the web, only the web)
>
>
>
> So...
>
> Goals of fastCache :
> - Perfs
> - Can be used by end users and as a piece of larger scripts
> - Avoid corrupted cache (even with NFS)
>
> The mainly problem is now the name of the class/package ? Ideas ?
>
> Fabien
>
>
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>