Caching Emotes for an Electron Desktop app

Hi everyone! I’m currently re-writing my Twitch chatbot not in Python anymore but in Electron. This time, I want to improve streamer’s chat experience by adding Twitch, BTTV and FFZ emote support.
On the API documentation, I read about emote caching for browser app or extensions.

The question is: do I need to cache emotes? And if so, how am I supposed to do?

Probably not no

Entirely up to you

There are so many chat emotes, it’s not worth it to cache them, you don’t know which ones you will need and thus dunno what you need to cache.

Personally I don’t cache, but I do preload the Twitch Emotes for the logged in user. I don’t bother with FFZ/BTTV. But this is not for a chat notification. For Chat I direct the user to the Twitch website instead where all the latest Twitch Features are available.

Thanks! So I can check for the emote ID and fetch the link from twitchemotes or something every time?
Sounds like there would be too many requests tbh.

Errr no.

If you are doing at that point in time, that there’s no point doing any additional action.

Just display the emote, and let chromium handle it, because it’s too late if you are preloading/caching at the moment of display of the chat line/emote.

I checked to see what I do, I don’t bother preloading Emotes at all, just channel/chat items (chat badges)

Yes this makes actually sense. I’ll try to have a look at “chromium emote handling”.
What other app such as Chatty do is probably cache emotes on their server and fetch is from there, I think.

Err no. Chatty doesn’t cache emotes, it loads the emotes directly from Twitch when they appear in chat. Using an img HTML tag or equivalent.

https://static-cdn.jtvnw.net/emoticons/v1/EMOTEID/SIZE

Where size is 1.0, 2.0 or 3.0

That’s not a specific thing. I was referring to how browsers internally cache images/css/js etc

What are you trying to do, to make you think you need “caching”

Oh ok, nice! Sorry, I’m totally new to this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.