• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Last Modified HTTP Header in CSS

Marcus

Well-known member
#1
The CSS files produced from XenForo don't get the correct last modified http header value. XenForo\CssOutput::displayCss() returns "Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT" despite:
PHP:
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->_styleModifiedDate) . ' GMT')
Quick fix to change it to page generation time:
PHP:
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
The Cache-Control header could include the max-age attribute, as the Expires header is already setup to 2020. Adding an ETag (Enable ETag support for CSS Resource) would be great, too.
 
Last edited: