X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/8d0254ce8a1ebceb80a2d14af414af1ca0a972be..HEAD:/foto/index.php diff --git a/foto/index.php b/foto/index.php index 1ebb539..45c49c9 100644 --- a/foto/index.php +++ b/foto/index.php @@ -11,6 +11,13 @@ $Page->title = ($nav ? implode(' ', $nav) . ': ' : '') . $title; if ($_SERVER['HTTP_ACCEPT'] === 'application/json') { header('Access-Control-Allow-Origin: *'); + header('Cache-Control: max-age=10'); + if (file_exists($rootdir)) { + header('Last-Modified: '.gmdate(DATE_RFC7231, filemtime($rootdir))); + } + else { + http_response_code(404); + } $imgs = []; foreach (glob("$rootdir/*.jpg") as $path) { $target = preg_replace('{^(\.\./)*}', '', readlink($path));