Contacts+OC_Respone: Move enableCaching out of setEtagHeader and setLastModifiedHeader
This commit is contained in:
parent
0fd5252cfc
commit
594dcf13f2
|
@ -21,6 +21,7 @@ $image = new OC_Image();
|
|||
if( is_null($contact)) {
|
||||
OC_Log::write('contacts','photo.php. The VCard for ID '.$id.' is not RFC compatible',OC_Log::ERROR);
|
||||
} else {
|
||||
OC_Response::enableCaching();
|
||||
OC_Contacts_App::setLastModifiedHeader($contact);
|
||||
|
||||
// Photo :-)
|
||||
|
|
|
@ -48,6 +48,7 @@ if(is_null($contact)){
|
|||
getStandardImage();
|
||||
exit();
|
||||
}
|
||||
OC_Response::enableCaching();
|
||||
OC_Contacts_App::setLastModifiedHeader($contact);
|
||||
|
||||
$thumbnail_size = 23;
|
||||
|
|
|
@ -63,6 +63,7 @@ class OC_Response {
|
|||
$expires->add(new DateInterval($interval));
|
||||
}
|
||||
if ($expires instanceof DateTime) {
|
||||
$expires->setTimezone(new DateTimeZone('GMT'));
|
||||
$expires = $expires->format(DateTime::RFC2822);
|
||||
}
|
||||
header('Expires: '.$expires);
|
||||
|
@ -72,7 +73,6 @@ class OC_Response {
|
|||
if (empty($etag)) {
|
||||
return;
|
||||
}
|
||||
self::enableCaching();
|
||||
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) &&
|
||||
trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
|
||||
self::setStatus(self::STATUS_NOT_MODIFIED);
|
||||
|
@ -88,7 +88,6 @@ class OC_Response {
|
|||
if ($lastModified instanceof DateTime) {
|
||||
$lastModified = $lastModified->format(DateTime::RFC2822);
|
||||
}
|
||||
self::enableCaching();
|
||||
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
|
||||
trim($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModified) {
|
||||
self::setStatus(self::STATUS_NOT_MODIFIED);
|
||||
|
|
Loading…
Reference in New Issue