<?php
include "Cache.php";

$contents = "";

$store_as = "file";
$options = array("cache_dir" => getcwd() . "/cache");

$cache = new cache($store_as, $options);
$cached_id = $cache->generateID($_SERVER["PHP_SELF"]);

if ($content = $cache->get($cached_id))
  echo $content;
else {
  ob_start();
  // ...PHP script which results in output goes here.
  $content = ob_get_contents();
  ob_end_clean();
  $cache->save($cached_id, $content, 3600);
  echo $contents;
}

print "<a href='./'>See the result</a>\n";
?>
