From f56fc83f58c530da785344c23014d2d197ae14ae Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 27 Jun 2020 17:56:34 +0200 Subject: [PATCH] Update maxAge and eTag for media files --- wcfsetup/install/files/lib/page/MediaPage.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/page/MediaPage.class.php b/wcfsetup/install/files/lib/page/MediaPage.class.php index 2311fad04a..b78ae5816d 100644 --- a/wcfsetup/install/files/lib/page/MediaPage.class.php +++ b/wcfsetup/install/files/lib/page/MediaPage.class.php @@ -85,7 +85,10 @@ class MediaPage extends AbstractPage { $this->eTag = $this->mediaID; } + $this->eTag .= '_' . $this->media->fileHash; + // init file reader + $maxAge = 3600; $this->fileReader = new FileReader($location, [ 'filename' => $this->media->filename, 'mimeType' => $mimeType, @@ -93,8 +96,8 @@ class MediaPage extends AbstractPage { 'showInline' => in_array($mimeType, self::$inlineMimeTypes), 'enableRangeSupport' => $this->thumbnail ? true : false, 'lastModificationTime' => $this->media->fileUpdateTime ?? $this->media->uploadTime, - 'expirationDate' => TIME_NOW + 31536000, - 'maxAge' => 31536000, + 'expirationDate' => TIME_NOW + $maxAge, + 'maxAge' => $maxAge, ]); if ($this->eTag !== null) { -- 2.20.1