Since we now heavily use this endpoint for the contacts menu we better
set proper caching on the images. Else this gets reload over and over
again leading to slow loading menu and unneded bytes transfered.
* cache for 1 hour by default
* added ETag for validation
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
}
if ($result = $this->getPhoto($node)) {
+ // Allow caching
+ $response->setHeader('Cache-Control', 'private, max-age=3600, must-revalidate');
+ $response->setHeader('Etag', $node->getETag() );
+ $response->setHeader('Pragma', 'public');
+
$response->setHeader('Content-Type', $result['Content-Type']);
$response->setHeader('Content-Disposition', 'attachment');
$response->setStatus(200);