get( 'home' ); $last = $cache->lastModified(); $t = time(); if ($t - $last> $max_age) { $res = ''; } if ($cache->lastModified() < 1466053602) //Last changed Thu, 16 Jun 2016 05:06:42 +0000 $res = ''; //non-blank, or db failed and not allowed to cache if ( (($res != '') || ($db_failed> 0)) && ($_GET['nocache'] != 1) ) //note - for testing { header("Last-Modified: " . gmdate("D, d M Y H:i:s", $cache->lastModified() ) . " GMT", true); header("x-from-cache: true" ); $regen_cache = 0; } else { header("Last-Modified: " . gmdate("D, d M Y H:i:s", time() ) . " GMT", true); header("x-from-cache: false" ); $regen_cache = 1; } global $site_name, $total_downloads, $sitestats; include_once 'header1.php'; $sitestats = $total_downloads . ' files'; if ($regen_cache) { $smarty = newSmarty(); $smarty->assign( 'sitestats', $sitestats ); $res = $smarty->fetch( 'index.tpl' ); $res = reduce_text($res); $cache->save( $res ); } $res = substitute_before_display( $res ); substitute_header_code_into_text( $res ); include_once 'footer2.php'; ?>