X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoco.php;h=73179a33f203bab06ab49f6b893471c3117a7b16;hb=1eadcb48552ef0ae1f0bae22103c77b21e2ec517;hp=651b9938b9dde0a077ca3bf93078fc417628ecb7;hpb=dbcaf5192315d00f73c88d54e413c827fd31759b;p=friendica.git diff --git a/mod/poco.php b/mod/poco.php index 651b9938b9..73179a33f2 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -1,6 +1,6 @@ get("about:" . $contact['updated'] . ":" . $contact['nurl']); + + $cacheKey = 'about:' . $contact['nick'] . ':' . DateTimeFormat::utc($contact['updated'], DateTimeFormat::ATOM); + $about = DI::cache()->get($cacheKey); if (is_null($about)) { $about = BBCode::convertForUriId($contact['uri-id'], $contact['about']); - DI::cache()->set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about); + DI::cache()->set($cacheKey, $about); } // Non connected persons can only see the keywords of a Diaspora account @@ -226,14 +230,10 @@ function poco_init(App $a) { Logger::info("End of poco"); if ($format === 'xml') { - header('Content-type: text/xml'); - echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret])); - exit(); + System::httpExit(Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret])), Response::TYPE_XML); } if ($format === 'json') { - header('Content-type: application/json'); - echo json_encode($ret); - exit(); + System::jsonExit($ret); } else { throw new \Friendica\Network\HTTPException\InternalServerErrorException(); }