1. 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

Discussion in 'Resolved Bug Reports' started by Marcus, Mar 1, 2015.

  1. Marcus

    Marcus Well-Known Member

    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:
    header('Last-Modified: ' gmdate('D, d M Y H:i:s'$this->_styleModifiedDate) . ' GMT')
    Quick fix to change it to page generation time:
    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: Mar 1, 2015
    batpool52! likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    This behavior appears to be specific to when the CSS cache is enabled. In this case, we now use the input last modified date to build the header.
    Jarod and Marcus like this.

Share This Page