From 2c052fee902a8875e4a47d70694ac76f78e5676c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 5 Aug 2019 17:28:29 +0800 Subject: [PATCH] * finish task #6177. --- module/file/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/file/control.php b/module/file/control.php index 8aaedb249f..d23018f8d7 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -502,10 +502,10 @@ class file extends control $mime = in_array($file->extension, $this->config->file->imageExtensions) ? "image/{$file->extension}" : $this->config->file->mimes['default']; header("Content-type: $mime"); - $cacheMaxAge = $this->config->cookieLife - time(); + $cacheMaxAge = 10 * 365 * 24 * 3600; header("Cache-Control: private"); header("Pragma: cache"); - header("Expires:" . gmdate("D, d M Y H:i:s", $this->config->cookieLife) . " GMT"); + header("Expires:" . gmdate("D, d M Y H:i:s", time() + $cacheMaxAge) . " GMT"); header("Cache-Control: max-age=$cacheMaxAge"); $handle = fopen($file->realPath, "r");