$last_updated) $last_updated = $file_last_updated; } } } /** * Cache manifest file * @param EesyPHP\UrlRequest $request * @return void */ function handle_cache_manifest($request) { $cache = ["home"]; $last_updated = filemtime(Tpl::resolve_templates_path("index.tpl")); foreach (Tpl::static_directories() as $static_directory) _list_static_directory_files($static_directory, $static_directory, $cache, $last_updated); Tpl::assign("cache", $cache); Tpl::assign("last_updated", date("Y/m/d H:i:s", $last_updated)); header("Content-type: text/plain"); $content = Tpl::fetch("cache_manifest.tpl"); $etag = md5($content); header("Cache-Control: max-age=3000, must-revalidate"); header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_updated)." GMT"); header("Etag: $etag"); print($content); exit(); } Url :: add_url_handler("#^cache\.manifest$#", 'handle_cache_manifest'); # vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab