]> git.mxchange.org Git - friendica.git/commitdiff
Caching for profiles removed
authorMichael <heluecht@pirati.ca>
Tue, 17 May 2022 12:53:31 +0000 (12:53 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 17 May 2022 12:53:31 +0000 (12:53 +0000)
src/Model/Item.php
src/Protocol/ActivityPub/Transmitter.php

index 8bf133f5d8e65b87ba1b48a5d982b95ecbc3a1ff..50ef7c8c06c807116d89a95eb3489cca152307fa 100644 (file)
@@ -1225,7 +1225,6 @@ class Item
 
                if ($posted_item['origin'] && ($posted_item['uid'] != 0) && in_array($posted_item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT])) {
                        DI::cache()->delete(ActivityPub\Transmitter::CACHEKEY_OUTBOX . $posted_item['uid']);
-                       DI::cache()->delete(ActivityPub\Transmitter::CACHEKEY_PROFILE . $posted_item['uid']);
                }
 
                return $post_user_id;
index 6701f4254ca60882bbee429ff9bce119f07fd684..023bd5c83cce179c8c6cd16d2f9408b099f41f72 100644 (file)
@@ -61,7 +61,6 @@ class Transmitter
        const CACHEKEY_FEATURED = 'transmitter:getFeatured:';
        const CACHEKEY_CONTACTS = 'transmitter:getContacts:';
        const CACHEKEY_OUTBOX   = 'transmitter:getOutbox:';
-       const CACHEKEY_PROFILE  = 'transmitter:getProfile:';
 
        /**
         * Add relay servers to the list of inboxes
@@ -430,19 +429,12 @@ class Transmitter
         * Return the ActivityPub profile of the given user
         *
         * @param int $uid User ID
-        * @param boolean $nocache   Wether to bypass caching
         * @return array with profile data
         * @throws HTTPException\NotFoundException
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function getProfile(int $uid, $nocache = false): array
+       public static function getProfile(int $uid): array
        {
-               $cachekey = self::CACHEKEY_PROFILE . $uid;
-               $result = DI::cache()->get($cachekey);
-               if (!$nocache && !is_null($result)) {
-                       return $result;
-               }
-
                $owner = User::getOwnerDataById($uid);
                if (!isset($owner['id'])) {
                        DI::logger()->error('Unable to find owner data for uid', ['uid' => $uid, 'callstack' => System::callstack(20)]);
@@ -536,8 +528,6 @@ class Transmitter
 
                $data['generator'] = self::getService();
 
-               DI::cache()->set($cachekey, $data, Duration::DAY);
-
                // tags: https://kitty.town/@inmysocks/100656097926961126.json
                return $data;
        }