AiursoftWeb / Kahla.App

Kahla is a cross-platform business messaging app.
https://www.kahla.app
MIT License
415 stars 85 forks source link

Shall we cache the pbtoken? #887

Closed Anduin2017 closed 4 years ago

Anduin2017 commented 4 years ago

What do you suggest we do?

Now that every time the user opens a conversation's talking page, he gonna request a new pbtoken. That's fine.

But however, with the token changing, every time he opens the same conversation, it requires him to fully reload all photos from the probe. That might cause the resources download multiple times.

The lifetime of a pbtoken is 1 hour. But usually, the user won't stay in a conversation for more than 20 minutes. So what about cache all conversation - pbtoken keymap, and save the conversationId, tokenValue and tokenOutTime to local storage?

So every time I open the same conversation, gonna query for a token which lifetime still remains for more than 20 minutes? If not found, then request a new one. So the download link of our resources can be unchanged.

Additional context

Nothing.