Improved avatar loading speed

This commit is contained in:
Marcin Kurczewski 2014-09-08 22:02:45 +02:00
parent 91e140293e
commit a5c89bc48e
2 changed files with 7 additions and 1 deletions

View file

@ -53,7 +53,7 @@ final class UserAvatarController extends AbstractController
private function serveFromUrl($url) private function serveFromUrl($url)
{ {
$this->httpHelper->nonCachedRedirect($url); $this->httpHelper->redirect($url);
} }
private function serveFromFile($file, $size) private function serveFromFile($file, $size)

View file

@ -46,6 +46,12 @@ class HttpHelper
return $requestUri; return $requestUri;
} }
public function redirect($destination)
{
$this->setResponseCode(307);
$this->setHeader('Location', $destination);
}
public function nonCachedRedirect($destination) public function nonCachedRedirect($destination)
{ {
$this->setResponseCode(303); $this->setResponseCode(303);