* bring back cache-busting for feed icons based on timestamp

* DiskCache: use singleton pattern to create less cache object instances
 * DiskCache: implement ETag
This commit is contained in:
Andrew Dolgov
2022-12-19 21:36:50 +03:00
parent 20d6aaa9ab
commit d373b7b452
10 changed files with 43 additions and 31 deletions

View File

@@ -759,7 +759,7 @@ class Handler_Public extends Handler {
// we do not allow files with extensions at the moment
$filename = str_replace(".", "", $filename);
$cache = new DiskCache($cache_dir);
$cache = DiskCache::instance($cache_dir);
if ($cache->exists($filename)) {
$cache->send($filename);
@@ -771,7 +771,7 @@ class Handler_Public extends Handler {
function feed_icon() : void {
$id = (int)$_REQUEST['id'];
$cache = new DiskCache('feed-icons');
$cache = DiskCache::instance('feed-icons');
if ($cache->exists((string)$id)) {
$cache->send((string)$id);