# Post showing up in global feed slow

**URL:** <https://forum.social.plus/t/post-showing-up-in-global-feed-slow/1182>\
**Category:** General\
**Created:** [March 7, 2024, 4:40pm UTC](https://forum.social.plus/t/post-showing-up-in-global-feed-slow/1182 "2024-03-07T16:40:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielkang98](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@danielkang98](https://forum.social.plus/u/danielkang98)\
**Post date:** [March 7, 2024, 4:40pm UTC](https://forum.social.plus/t/post-showing-up-in-global-feed-slow/1182/1 "2024-03-07T16:40:35Z")

</div>

When I create a post like below method `createMyImagePost` and after the post being posted. When I call `getGlobalFeed`. Sometimes the getglobalfeed gets the post right away but some other times the post gets retrieved after waiting for minutes (ex. over 5 minutes or more). What may be the issue and how can I see updated global feed right away after post has been posted.

createMyImagePost Method

```auto

  Future<AmityPost> createMyImagePost(
    AmityImage uploadedImage,
  ) async {
    try {
      AmityPost post = await AmitySocialClient.newPostRepository()
          .createPost()
          .targetMe()
          .image([uploadedImage])
          .text('')
          .post();
      AppLogger.logInfo('createMyImagePost success: ${post.postId}');
      return post;
    } catch (exception) {
      AppLogger.logError('createMyImagePost error: ${exception.toString()}');
      rethrow;
    }
  }

```

getGlobalFeed Method

```auto
    _controller = PagingController(
      pageFuture: (token) => AmitySocialClient.newFeedRepository()
          .getGlobalFeed()
          .getPagingData(token: token, limit: 20),
      pageSize: 20,
    )..addListener(
        () {
          if (_controller.error == null) {
            //handle results, we suggest to clear the previous items
            //and add with the latest _controller.loadedItems
            lockedPosts.clear();
            unlockedPosts.clear();
            try {
              //? categorize the posts by comparing previous unlocked time
              for (AmityPost amityPost in _controller.loadedItems) {
                DateTime postCreatedAt = amityPost.createdAt!;
                //? if previousUnlockedTime is null then lock all photos
                if (locktimeService.previousUnlockedTime == null) {
                  lockedPosts.add(amityPost);
                }

                //? if postCreatedAt is before or equal to the previousUnlockedTime then unlock, else lock
                else if (postCreatedAt.isBefore(
                        locktimeService.previousUnlockedTime!.toUtc()) ||
                    postCreatedAt.isAtSameMomentAs(
                        locktimeService.previousUnlockedTime!.toUtc())) {
                  //* add to unlockedPosts
                  unlockedPosts.add(amityPost);
                } else {
                  //* add to lockedPosts
                  lockedPosts.add(amityPost);
                }
              }

              //? Retrieve Fam Images
              _retrieveFamImages();

              AppLogger.logInfo(
                  'Updated lockedPosts: ${lockedPosts.length} unlockedPosts: ${unlockedPosts.length}');
            } catch (exception) {
              AppLogger.logError('Error in categorizing posts: $exception');
            }
            lockedPosts.refresh();
            unlockedPosts.refresh();
            //update widgets
          } else {
            //error on pagination controller
            //update widgets
          }
        },
      );

```

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [March 8, 2024, 3:05am UTC](https://forum.social.plus/t/post-showing-up-in-global-feed-slow/1182/2 "2024-03-08T03:05:09Z")

</div>

Hello, to enhance loading time, we recommend changing your feed order to chronological. This adjustment will improve the loading time for post appearances.

f you’re interested in making this adjustment, please feel free to contact our support team at [support.asc@amity.co](mailto:support.asc@amity.co)
