Enable art caching and switch to redirect for generic image for speed.

This commit is contained in:
Buster "Silver Eagle" Neece 2017-11-03 23:24:36 -05:00
parent 29db397531
commit 5b807e83e5
2 changed files with 2 additions and 4 deletions

View File

@ -41,15 +41,13 @@ class MediaController extends BaseController
return $this->response
->withStatus(200)
->withHeader('Content-Type', 'image/jpeg')
->withHeader('Cache-Control', 'public, max-age=31536000')
->withBody(new \Slim\Http\Stream($art));
}
}
$missing_image_url = APP_INCLUDE_ROOT.'/resources/generic_song.jpg';
return $this->response
->withStatus(404)
->withHeader('Content-Type', 'image/jpeg')
->withBody(new \Slim\Http\Stream(fopen($missing_image_url, 'r')));
return $this->response->withRedirect($this->url->content('img/generic_song.jpg'), 302);
}
}

View File

Before

Width:  |  Height:  |  Size: 808 KiB

After

Width:  |  Height:  |  Size: 808 KiB