rework favicon storage to use DiskCache

This commit is contained in:
Andrew Dolgov
2022-11-24 23:31:33 +03:00
parent be6bc72a74
commit a30b9bb649
10 changed files with 167 additions and 74 deletions

View File

@@ -769,6 +769,18 @@ class Handler_Public extends Handler {
}
}
function feed_icon() : void {
$id = (int)$_REQUEST['id'];
$cache = new DiskCache('feed-icons');
if ($cache->exists((string)$id)) {
$cache->send((string)$id);
} else {
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
echo "File not found.";
}
}
private function _make_article_tag_uri(int $id, string $timestamp): string {
$timestamp = date("Y-m-d", strtotime($timestamp));