How properly and efficient load chats and messages in those chats. Messages could be text/mp3/mp4/files.
Problem overview: I got messager-like web app(similar to whatsApp). On page load i fetch from my api only chats that user have.Then when user click on any chat it starts to load first 25 messages from chat and display it as ready(user sees loading screen). So when user flit between different chats he gets bad user experiense because of loading screens every time.
I believe someone have consideration how i can improove efficiency and user exp using some technic or maybe different approach. What i want basically is maybe make my chats on first load page loads with messages, or use cached messages before new one loads to eliminate load screens, idk.
Code is not important here, is more about stategy . THX EVERYONE