// First create a folder named "cache" where the files will be written <br />// define the fonction <br />function BZ_cache ($url,$cacheName) <br />{ <br />global $cache ; <br />global $QUERY_STRING ; <br />// You may use the naming convention of you choice here <br />$filename = "cache/".$cacheName.",".$QUERY_STRING.".html" ; <br /><br />// You may use test the date of the cache here <br /> if ( file_exists ( $filename) ) <br /> { <br /> readfile ($filename) ; <br /> return 1 ; /// Ok i'v send the html page <br /> } <br />else <br /> { <br /> if ( ! isset ($cache ) ) <br /> { <br /> $fcontents = join ('', file ($url."?".$QUERY_STRING."&cache=t")); <br /> $fp = fopen ($filename , "w"); <br /> fwrite ($fp, $fcontents ); <br /> fclose ( $fp) ; <br /> return 0 ; /// i'v to execute the file <br /> } <br /> } <br />} <br />// then put this line at the TOP of you file ( before any include ) <br />// if ( BZ_cache ("COMPLETE URL WITHOUT PARAMS" , "AN_IDENTIFIER" ) ) exit () ; <br /><br /><br />// Example in the file http://azerclic.labynet.org/doc.php3 <br />// the first line is <br />// if ( BZ_cache ("http://azerclic.labynet.org/doc.php3" , "doc" ) ) exit () ; <br />// you will see the cached files in the folder http://azerclic.labynet.org/cache/ <br />// That's all <br />