mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Update cache
This commit is contained in:
@@ -59,22 +59,15 @@ return call_user_func(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$response = \set_export::stream_file($pathOut, $file->get_file(), $file->get_mime(), 'attachment');
|
$response = \set_export::stream_file($pathOut, $file->get_file(), $file->get_mime(), 'attachment');
|
||||||
|
$response->setPrivate();
|
||||||
$cacheOptions = array(
|
|
||||||
'max_age' => 0,
|
|
||||||
's_maxage' => 0,
|
|
||||||
'private' => true,
|
|
||||||
'public' => false,
|
|
||||||
);
|
|
||||||
|
|
||||||
/* @var $response \Symfony\Component\HttpFoundation\Response */
|
/* @var $response \Symfony\Component\HttpFoundation\Response */
|
||||||
if ($file->getEtag()) {
|
if ($file->getEtag()) {
|
||||||
|
$response->setEtag($file->getEtag());
|
||||||
$cacheOptions['etag'] = $file->getEtag();
|
$response->setLastModified($file->get_modification_date());
|
||||||
$cacheOptions['last_modified'] = $file->get_modification_date();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$response->setCache($cacheOptions);
|
$response->headers->addCacheControlDirective('must-revalidate', true);
|
||||||
$response->isNotModified($request);
|
$response->isNotModified($request);
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
@@ -209,6 +202,7 @@ return call_user_func(
|
|||||||
|
|
||||||
|
|
||||||
$app->error(function (\Exception $e) {
|
$app->error(function (\Exception $e) {
|
||||||
|
var_dump($e->getMessage());
|
||||||
if ($e instanceof \Exception_Session_NotAuthenticated) {
|
if ($e instanceof \Exception_Session_NotAuthenticated) {
|
||||||
$code = 403;
|
$code = 403;
|
||||||
$message = 'Forbidden';
|
$message = 'Forbidden';
|
||||||
|
Reference in New Issue
Block a user