Пример #1
0
 /**
  * Make image response.
  *
  * @param $file
  * @return \Illuminate\Http\Response
  */
 public function image($file)
 {
     $image = $this->document->image($file);
     $reqEtag = Request::getEtags();
     $genEtag = $this->document->etag($file);
     if (isset($reqEtag[0])) {
         if ($reqEtag[0] === $genEtag) {
             return response('', 304);
         }
     }
     return response($image->encode('png'), 200, ['Content-Type' => 'image/png', 'Cache-Control' => 'public, max-age=0', 'Etag' => $genEtag]);
 }