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

**URL:** https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698
**Category:** Bug
**Created:** [19 Ottobre 2015, 11:20pm UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698 "2015-10-19T23:20:49Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [19 Ottobre 2015, 11:20pm UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/1 "2015-10-19T23:20:49Z")

</div>

You probably already know about this but I thought I would mention that during a quick test with [http://www.webpagetest.org/](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://global.discourse-cdn.com/meta/user\_avatar/](https://global.discourse-cdn.com/meta/user_avatar/)…  
to: [https://global.discourse-cdn.com/meta/optimized/](https://global.discourse-cdn.com/meta/optimized/)…

Based on looking at the test results here:  
[http://www.webpagetest.org/result/151019\_S0\_26cd86a4691772b6221b4dc433576e7a/](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/video/view.php?id=151019_S0_26cd86a4691772b6221b4dc433576e7a.1.0)

[http://www.webpagetest.org/result/151019\_H1\_085fc810046b2e8cdd14a7af1d6b020d/](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

---

<div class="post-metadata">

### Author: ![purldator](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@purldator](https://meta.discourse.org/u/purldator)
#### Post date: [19 Ottobre 2015, 11:22pm UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/2 "2015-10-19T23:22:30Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 Ottobre 2015, 11:22pm UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/3 "2015-10-19T23:22:41Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 Ottobre 2015, 11:23pm UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/4 "2015-10-19T23:23:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 Ottobre 2015, 11:27pm UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/5 "2015-10-19T23:27:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 Ottobre 2015, 11:27pm UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/6 "2015-10-19T23:27:48Z")

</div>

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

You can see it in the filmstrip view [http://www.webpagetest.org/video/compare.php?tests=151019\_S0\_26cd86a4691772b6221b4dc433576e7a-r:1-c:0](http://www.webpagetest.org/video/compare.php?tests=151019_S0_26cd86a4691772b6221b4dc433576e7a-r:1-c:0)

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

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [27 Ottobre 2015, 4:19am UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/7 "2015-10-27T04:19:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [16 Dicembre 2015, 2:38am UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/8 "2015-12-16T02:38:41Z")

</div>

Fixed per:

[https://github.com/discourse/discourse/commit/a0e38a52ede4b387e529fb469db5ec946950a53e](https://github.com/discourse/discourse/commit/a0e38a52ede4b387e529fb469db5ec946950a53e)

 ![](https://global.discourse-cdn.com/meta/original/3X/8/d/8d9cff86f1c152031a3331b0f3bf1244003d9825.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [16 Dicembre 2015, 2:38am UTC](https://meta.discourse.org/t/slowness-in-loading-avatars-on-meta-discourse-org/34698/9 "2015-12-16T02:38:52Z")

</div>


