Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Commit

Permalink
change serve image over header redirect instead of file get contents
Browse files Browse the repository at this point in the history
  • Loading branch information
kevbaldwyn committed Aug 12, 2014
1 parent fadc113 commit d875457
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/KevBaldwyn/Image/Cache/ImageFileCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@ public function serve()
{
// which is faster?
// 301 to file / url
//header('Location: ' . $this->saveHandler->getPublicServePath() . $this->getFilename());
//die();
header('HTTP/1.1 301');
header('Location: ' . $this->saveHandler->getPublicServePath() . $this->getFilename());
die();

// read file and output
/*
$file = $this->saveHandler->getPublicServePath() . $this->getFilename();
$mimetype = exif_imagetype($file);
header('Content-Type: '.$mimetype);
readfile($file);
die();
*/
}


Expand Down

0 comments on commit d875457

Please sign in to comment.