/** * Make the response. * * @param FileInterface $file * @return Response */ public function make(FileInterface $file) { // Start the response. $response = $this->response->make(); $response->headers->set('Etag', $file->etag()); $response->headers->set('Content-Type', $file->getMimetype()); $response->headers->set('Last-Modified', $file->lastModified()->setTimezone('GMT')->format('D, d M Y H:i:s')); $response->setTtl(3600); return $response; }
/** * Make the response. * * @param FileInterface $file * @return Response */ public function make(FileInterface $file) { // Start the response. $response = $this->response->make(); $response->headers->set('Pragma', 'public'); $response->headers->set('Etag', $file->hash()); $response->headers->set('Content-Length', $file->getSize()); $response->headers->set('Content-Type', $file->getMimetype()); $response->headers->set('Cache-Control', 'public,max-age=300,s-maxage=900'); // Should be configurable $response->headers->set('Last-Modified', $file->lastModified()->setTimezone('GMT')->format('D, d M Y H:i:s')); return $response; }