# Slow loading times for a topic's title

**URL:** https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579
**Category:** UX
**Created:** [20 Marzo 2017, 9:51pm UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579 "2017-03-20T21:51:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [20 Marzo 2017, 9:51pm UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/1 "2017-03-20T21:51:59Z")

</div>

Continuing the discussion from [Can I add a loading image like slack has while the app is loading?](https://meta.discourse.org/t/can-i-add-a-loading-image-like-slack-has-while-the-app-is-loading/32101):

I’ve seen this behavior a number of times recently, it’s kind of ironic that the topic I clicked on which ended up prompting me to stop & start a topic is one about slow load times.

The issue at hand is that when I’m on a `Topic A` and client on a link at the bottom to `Topic B`, both the URL in my browser (chrome on mac) and the window’s title change quickly, but the topic title doesn’t change until after more of the page loads.

 ![](https://global.discourse-cdn.com/meta/original/3X/2/7/27434b50b2d45ed9ea8b083ced71f87a0f50373a.png)

I’ve seen this here on meta more than anywhere else. Outside of making pages load faster, I wonder if the updating of the title itself should get prioritized?

---

<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: [20 Marzo 2017, 10:06pm UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/2 "2017-03-20T22:06:16Z")

</div>

I really like this observation, we can certainly re-render the header right away on click.

@eviltrout maybe have a look at it.

Repro is visiting a topic, clicking on a suggested topic. The expectation is that the header would re-render right away with the new title / category and so on. Instead you see the spinner and old title.

---

<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: [21 Marzo 2017, 12:39am UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/3 "2017-03-21T00:39:55Z")

</div>

Sure I support this if it is easy, seems like a nice change.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [21 Marzo 2017, 8:00pm UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/5 "2017-03-21T20:00:12Z")

</div>

This is more complicated than you might think.

The suggested topics list is done with raw handlebars, so each link is just a regular link that is run through our router. We know the URL to update right away because it comes from the link, but we don’t have the data object to use for the title / category.

(If it was a regular handlebars template we’d have an easy reference to the object for updating instantly like that.)

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [22 Marzo 2017, 8:58am UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/6 "2017-03-22T08:58:03Z")

</div>

In that case, blanking out the title might actually look better than keeping the old title?

Keeping the old title is weird in some way, the title simply being removed together with the content of the page seems pretty consistent to me 🙂

---

<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: [22 Marzo 2017, 11:03pm UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/7 "2017-03-22T23:03:12Z")

</div>

Sure let’s go with that @eviltrout, removal, since that has to be easy, I hope?

---

<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: [23 Marzo 2017, 1:45am UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/8 "2017-03-23T01:45:41Z")

</div>

I think we have a component per row and it has the backing topic, it handles the click. Can it be extended to sort this out @eviltrout? (components/topic-list-item.js.es6)?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [23 Marzo 2017, 5:56pm UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/9 "2017-03-23T17:56:03Z")

</div>

Isn’t it always the way that simple appearing things are always more complicated? There were a lot of edge cases due to the topic title not always being visible, and it depending on a “loaded” state.

It took a while, but I think I managed to make our application a lot smarter about showing topic titles when navigating to them from topic lists.

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

and

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

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [23 Marzo 2017, 6:26pm UTC](https://meta.discourse.org/t/slow-loading-times-for-a-topics-title/59579/10 "2017-03-23T18:26:53Z")

</div>


