When using FileDownloadController::download()
with a file a public file scheme, \Symfony\Component\HttpFoundation\BinaryFileResponse
will set a header Cache-Control: public
. Which itself is fine, but it's missing a max-age. This is preventing assets from being cached. Possibly it's expected that anything implementing a BinaryFileResponse
would add max-age to the header.
In Drupal's case, we normally use mod_expires, as there is default code that comes with Drupal's htaccess. (I say normally as it's dependent on server configuration, but I think it's fairly standard practise to use this for setting cache headers on file assets).
However, mod_expires does not override existing headers, they need to not already exist on the response for it to work.
I've marked this as a minor, as it's probably a fairly low impact. In our case we are using the Flysystem module, which streams files through FileDownloadController::download()
. We want our aggregated CSS/JS to be cached in the users browser.
Active
10.1 ✨
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.