From: Matthias Schmidt Date: Sat, 27 Jun 2020 15:56:34 +0000 (+0200) Subject: Update maxAge and eTag for media files X-Git-Tag: 5.3.0_Alpha_1~151^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f56fc83f58c530da785344c23014d2d197ae14ae;p=GitHub%2FWoltLab%2FWCF.git Update maxAge and eTag for media files --- 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) {