foocache is a simple caching system for PHP4 which optionally uses HTML-tidy to clean up the generated HTML Code.
Instead of processing the whole page a cachefile is loaded if it exists, is younger than a defined age, a given reference file and the calling PHP file it self.
The name of the cache file is generated with the MD5 sum of the Request URI and the HTML post variables. foocache can highlight (search)strings in the output, too.
<? $foocache[query] = $_GET[search]; require "foocache.inc"; foocache_start(); ?> Here comes HTML, database queries and a lot of PHP stuff which takes some time... All the words given in the GET variable "search" will be highlighted, too. <? foocache_stop(); ?>
- Fixed small bug with regexp quoting on searchstring highlight
- Search-String highlighting was added
- now ob_get_length() is used instead of strlen() to get buffered content length (thanks to Pawel Krawczyk)
- additional options for tidy can be set with a variable - fixes problems with non iso-8859-1 input
- Fixed the cachefilenaming with post variables
- foocache now can be disabled by setting a define