From: Tim Düsterhus Date: Wed, 15 Jul 2020 11:43:51 +0000 (+0200) Subject: Increase max-age to 14 days in getFont.php X-Git-Tag: 5.3.0_Alpha_1~120^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ffad8993bb252b5fde43c68958b6bcc291ad781e;p=GitHub%2FWoltLab%2FWCF.git Increase max-age to 14 days in getFont.php --- diff --git a/wcfsetup/install/files/font/getFont.php b/wcfsetup/install/files/font/getFont.php index 4821d3d11d..5e32400f39 100644 --- a/wcfsetup/install/files/font/getFont.php +++ b/wcfsetup/install/files/font/getFont.php @@ -6,8 +6,8 @@ * - Firefox and Internet Explorer refuse to load fonts from different domains unless allowed by 'Access-Control-Allow-Origin' * - Chrome sometimes does not properly cache fonts, resulting in strange rendering bugs * - * @author Alexander Ebert, Sascha Greuel - * @copyright 2001-2019 WoltLab GmbH + * @author Tim Duesterhus, Alexander Ebert, Sascha Greuel + * @copyright 2001-2020 WoltLab GmbH * @license GNU Lesser General Public License */ @@ -72,11 +72,13 @@ $data = file_get_contents($filename); // send cache and type headers // allow font fetching from all domains (CORS) +const MAX_AGE = 86400 * 14; + header('Access-Control-Allow-Origin: *'); header('Content-Type: ' . $types[$type]); -header('Cache-Control: max-age=86400, public'); +header('Cache-Control: max-age=' . MAX_AGE . ', public'); header('ETag: ' . $etag); -header('Expires: ' . gmdate("D, d M Y H:i:s", time() + 86400) . ' GMT'); +header('Expires: ' . gmdate("D, d M Y H:i:s", time() + MAX_AGE) . ' GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $filemtime) . ' GMT'); header('Content-Length: ' . strlen($data));