Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Setting cache with htaccess


Eugenios - 6:09 pm on Aug 12, 2004 (gmt 0)


Many Thanks Jim, I will check that htaccess code.

In the meanwhile I'm using this script:

<?php
$cachefile = "cache/".$title.".html";

if (file_exists($cachefile))
{ include ($cachefile);
exit();
}

ob_start();
?>

Page with html and database here

<?php
$buffer = ob_get_contents();
$fp = fopen($cachefile, 'w');
fwrite($fp, $buffer);
fclose($fp);
?>

It doesn't check modification events, but it is what I need. Perhaps later I will add an expiration date.

I have yet to find how to do this with a perl script. I will post on the Perl forum to get help.

Thanks again,

Enrique


Thread source:: http://www.webmasterworld.com/apache/1922.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com