How to speed up Discourse Emoji


(Gulshan Kumar) #1

Hi,

I am sure, my Internet is not slow. It’s 5.3 Mbps. Still, I notice that Emoji loads very slow. It takes ages to load all icons. It would be great if we can preload it somehow.

image

Thanks & Regards,
Gulshan


(Bhanu Sharma) #4

As far as I know, all emojis are lazy loaded.
Have you checked your browser console’s network tab to see if it is discourse or your web server is the culprit?


(Gulshan Kumar) #5

I am not saying, it doesn’t load. It loads, but very slowly till you would already decide I don’t want to use emoji now. Because, searching for right emoji becomes difficult.

I will try to debug Console to see if there is any issue.


(Bhanu Sharma) #6

I’ve noticed that issue on your forum but never here on meta or on my own forum, looks like it’s very specific to you.


(Gulshan Kumar) #7

Maybe! I am not using Cloudflare or any third party even. I am more worried now when you already confirmed me.


(Bhanu Sharma) #8

That very much depends on available speed at your server and CDN. Have you tried configuring CDN on your forum yet?


(Gulshan Kumar) #9

I reloaded the forum web page, it fixed the problem instantly.

CDN would be helpful for delivering static content for new visitors only. For rest, it would be already cached.

I am skeptical about using CDN. I tried it, it was not huge difference.

I can try one more time to find out data result.

As a matter of Interactive session, for example if someone drop a new gif in message, I am afraid it can harm more, because the MISS response would be usually slower than the origin. Isn’t?

As per main audience location, I would prefer improving core server.


(Gulshan Kumar) #10

Can you please refer to this video, this is what exactly I am facing.


(Sam Saffron) #11

I can see the issue this is actually not network related.

I fixed it per:

What was happening is that Chrome likes “deferring” timers if they start taking too long.

  • We were batching “loading” up emojis
  • At some point chrome detected that our batches were taking more than 16ms
  • Chrome gets angry and says “no setTimer for you for 3 seconds or more”

This is an internal issue in Chrome we need to report to them, but in the meantime I amended it so we use animation frames which are designed with this in mind.