Slowness in loading Avatars on `meta.discourse.org`

You probably already know about this but I thought I would mention that during a quick test with http://www.webpagetest.org/

I can see there is a lot of time and requests being spent redirecting (302) from one CDN to another for the avatars.
from: https://d11a6trkgmumsb.cloudfront.net/user_avatar/
to: https://d11a6trkgmumsb.cloudfront.net/optimized/

Based on looking at the test results here:
http://www.webpagetest.org/result/151019_S0_26cd86a4691772b6221b4dc433576e7a/

It looks like this adds ~7 seconds to the load time for meta.discourse.org currently (30739ms / 4 connections).

A video:
http://www.webpagetest.org/video/view.php?id=151019_S0_26cd86a4691772b6221b4dc433576e7a.1.0

http://www.webpagetest.org/result/151019_H1_085fc810046b2e8cdd14a7af1d6b020d/


A side note - it would be nice if the initial render could take place without any avatars…
… and then later load them, getting that initial render quicker would be nice.

Obviously this might look very different when there are no 302 redirects

Yes.

I have endured the same. The fastly CDN and Meta’s CDN.

All images take measurable seconds that I can fully count until it finally loads.

This only happens when you store resources in S3 from what I understand. I do get initial render before avatars load, I know when we were in Australia on wifi I saw lots of slow network effects.

Why would image load block initial render? I certainly do not see that. The page has no knowledge of images until the JavaScript draws the html on the page…

Yeah, it is a known issue with S3 as an image host, we have a very yucky redirect.

We want to fix it but it is very complicated. If we can somehow get an avatar template going on s3 instead of different assets and guids for each resized avatar we may be able to correct it.

2 Likes

Why would avatar redirects block page load though? I don’t see how that is possible.

They are not blocking page loads, just making webpagetest be upset.

You can see it in the filmstrip view WebPageTest - Visual Comparison

webpage test does not consider a page loading until N percent of the page is displayed.

1 Like

You can also see that there’s a “1 new or updated topic” bar in the end, which lowers the completion%…

Fixed per:

https://github.com/discourse/discourse/commit/a0e38a52ede4b387e529fb469db5ec946950a53e

3 Likes