diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-02-12 17:20:30 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-02-12 17:21:33 +0100 |
commit | 0917bdecddd74a48ee2b21f18e184c579d156b62 (patch) | |
tree | 440ef374bcecc71752ecd3fa725165c9a8b94989 /apps/contacts/thumbnail.php | |
parent | a0bb6079c5169f7314b9c82983e7a019469c2a00 (diff) | |
download | nextcloud-server-0917bdecddd74a48ee2b21f18e184c579d156b62.tar.gz nextcloud-server-0917bdecddd74a48ee2b21f18e184c579d156b62.zip |
Contacts: Move response caching to OC_Response
Diffstat (limited to 'apps/contacts/thumbnail.php')
-rw-r--r-- | apps/contacts/thumbnail.php | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php index 4f65afb1540..d7043b75f04 100644 --- a/apps/contacts/thumbnail.php +++ b/apps/contacts/thumbnail.php @@ -58,27 +58,9 @@ $thumbnail_size = 23; // Find the photo from VCard. $image = new OC_Image(); $photo = $contact->getAsString('PHOTO'); -$etag = md5($photo); -$rev_string = $contact->getAsString('REV'); -if ($rev_string) { - $rev = DateTime::createFromFormat(DateTime::W3C, $rev_string); - $last_modified_time = $rev->format(DateTime::RFC2822); -} else { - $last_modified_time = null; -} -header('Cache-Control: cache'); -header('Pragma: cache'); -if ($rev_string) { - header('Last-Modified: '.$last_modified_time); -} -header('ETag: '.$etag); - -if (@trim($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || - @trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) { - header('HTTP/1.1 304 Not Modified'); - exit; -} +OC_Response::setETagHeader(md5($photo)); +OC_Contacts_App::setLastModifiedHeader($contact); if($image->loadFromBase64($photo)) { if($image->centerCrop()) { |