First create the "cache" directory, used to write file function Bz_cache ($url, $cacheName) {global $cache; global $QUERY _string;//Here you can name your own custom $fil ename = "cache/". $cacheName. ",". $QUERY _string. ". HTML "; Here you should also test the time of the file to see if it expires//(but not done here.) Oh! Do It yourself! if (file_exists ($filename)) {ReadFile ($filename); return 1;//Ok IV send the HTML page} else {if (! isset ( $cache) {$fcontents = join (, file ($url. "?"). $QUERY _string. " &cache=t ")); $fp = fopen ($filename, "w"); Fwrite ($fp, $fcontents); Fclose ($FP); return 0; IV to execute the file}}//At the very beginning of your PHP file put the following line of code//if (Bz_cache ("Complete URL without PARAMS", "An_identifier" ) exit (); Remember, this URL is to be complete, that is, the previous must have http://. But no arguments at the back. Online there is an example: HTTP://AZERCLIC.LABYNET.ORG/DOC.PHP3//First line is//if (Bz_cache ("Http://azerclic.labynet.org/doc.php3", "Doc" ) exit (); You will see cached file in http://azerclic.labynet.org/cache///thats all///Good luck! I estimate that under the WIN32 is not a problem, under Linux also must consider the permission question, because generally does not have the Write permission.
http://www.bkjia.com/PHPjc/531724.html www.bkjia.com true http://www.bkjia.com/PHPjc/531724.html techarticle /////Create the cache directory to write the file function Bz_cache ($url, $cacheName) {global $cache; global $QUERY _string;//Here you can name your own custom $f Ilename = ca ...