git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
widget/reply: lazy image loading in html5
[minimedit.git]
/
foto
/
index.php
diff --git
a/foto/index.php
b/foto/index.php
index 1ebb53986bc08c3046e94ca32a1b5b60d137ef64..45c49c90458fa05bd050b2ba38f707f8d8f01f08 100644
(file)
--- 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: *');
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));
$imgs = [];
foreach (glob("$rootdir/*.jpg") as $path) {
$target = preg_replace('{^(\.\./)*}', '', readlink($path));