# Optimizing Site For Speed - How To Improve?

**URL:** https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671
**Category:** Development
**Created:** [April 6, 2024, 1:29am UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671 "2024-04-06T01:29:03Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)
#### Post date: [April 6, 2024, 1:29am UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/1 "2024-04-06T01:29:03Z")

</div>

What’re your guys’ thoughts on these performance test websites? I just did 3 tests:  
GTmetrix, PageSpeed, and WebpageTest. Some variants, of course, but some similarities. Yesterday, I was a grade C on GTmetrix, so a B is a cool improvement - Not sure where that came from, though.

 ![gtmetrix.com_reports](https://global.discourse-cdn.com/meta/original/4X/e/1/5/e15530b610827073af79099b321a1f3d4242e598.jpeg)

 ![pagespeed.web.dev_analysis](https://global.discourse-cdn.com/meta/original/4X/9/5/a/95a2d5e81f28c8c10525915c6037999246e7bcf8.png)

 ![webpagetest.org_result](https://global.discourse-cdn.com/meta/original/4X/0/7/c/07c42c9b4d0d794dc5f2b40ace954cf143e483bc.png)

From what I can tell, seems like what’s most common with my site from these 3 tests are load times with Javascript & CSS. Is the JS even in my control, though? It lists the 2 URLs on GTmetrix as unused JS, but that’s stuff built into Discourse, isn’t it?

> [https://forums.gonomad.me/assets/chunk.2c7ac65fdfc1f35c61b6.d41d8cd9.js](https://forums.gonomad.me/assets/chunk.2c7ac65fdfc1f35c61b6.d41d8cd9.js)  
> [https://forums.gonomad.me/assets/vendor.47fe1949ff0285dbc995d87a6ae0d449-223fd39128ca149073c28a57e41e969bafdb0a241e1149adab6918b27e7a3265.js](https://forums.gonomad.me/assets/vendor.47fe1949ff0285dbc995d87a6ae0d449-223fd39128ca149073c28a57e41e969bafdb0a241e1149adab6918b27e7a3265.js)

And then I saw these listed as a **38.8s** path latency, which kinda piqued my interest. How in the world would I optimize/fix _that_?

 ![eeee](https://global.discourse-cdn.com/meta/original/4X/e/1/8/e18216fbb9dfa052e146cb0bea687184ddd1c323.png)

PageSpeed listed kinda the same thing with the JS/CSS render-blocking resources thing. The biggest JS files slowing the site down are:

> [https://forums.gonomad.me/assets/chunk.2c7ac65fdfc1f35c61b6.d41d8cd9.js](https://forums.gonomad.me/assets/chunk.2c7ac65fdfc1f35c61b6.d41d8cd9.js)  
> [https://forums.gonomad.me/assets/locales/en-d255b87afa1b13a48418c34b7c45d8aa69fce223261f36c9a101fb022c7cb8e5.js](https://forums.gonomad.me/assets/locales/en-d255b87afa1b13a48418c34b7c45d8aa69fce223261f36c9a101fb022c7cb8e5.js)

But again, I think that’s something baked into Discourse?

Finally, a direct Lighthouse test from Dev Console gave me a 63 score:

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

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 6, 2024, 12:42pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/2 "2024-04-06T12:42:39Z")

</div>

Is it related to the other topic where some users had loading issues?

I would look at the hosting environment instead. 🤔

The result looks fine to me, though

---

<div class="post-metadata">

### Author: ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)
#### Post date: [April 6, 2024, 1:17pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/3 "2024-04-06T13:17:37Z")

</div>

> [@Arkshine](#):
>
> Is it related to the other topic where some users had loading issues?

Sorta-kinda. That whole thing got me thinking, haha.

> [@Arkshine](#):
>
> I would look at the hosting environment instead.

That’s what I was mainly thinking as well, but eh, not liking some of the scores on these performance sites either (which, yeah, I guess could be host issues?)

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [April 6, 2024, 2:22pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/4 "2024-04-06T14:22:57Z")

</div>

Set up a CDN is always a good start. 🚀

> [@Enable a CDN for your Discourse](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857):
>
> So you’d like to use a CDN to speed up worldwide access to common assets on your Discourse forum? You might want to go all-in and [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) (see also [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916)). If you want a CDN without the added complexity of S3 and having two CDNs, this is the guide for you. The CDN will reduce some load on your server by letting the CDN serve those assets so that the server doesn’t have to. It also can speed things up by deliver…

---

<div class="post-metadata">

### Author: ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)
#### Post date: [April 6, 2024, 2:54pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/5 "2024-04-06T14:54:15Z")

</div>

I’ve read a lot about CDN’s lately on this optimization journey. Will check that out!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 6, 2024, 3:23pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/6 "2024-04-06T15:23:50Z")

</div>

Hmmm … it’s a lot of extra complexity for not much.

I’ve run a successful community for several years without having to use a CDN.

---

<div class="post-metadata">

### Author: ![eisammy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eisammy/32/528804_2.png) [@eisammy](https://meta.discourse.org/u/eisammy)
#### Post date: [April 6, 2024, 3:31pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/7 "2024-04-06T15:31:21Z")

</div>

High-Traffic? Could tell me his server config?

---

<div class="post-metadata">

### Author: ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)
#### Post date: [April 6, 2024, 3:33pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/8 "2024-04-06T15:33:14Z")

</div>

Shouldn’t be high traffic. Only have a couple registered users. Only made the site maybe 12 days ago. Seems to be slow for some around peak hours where the server is hosted, but fine for others. The server/VPS specs are:

3GB RAM  
2vCPU  
35GB SSD  
1Gbps Unmetered Bandwidth  
1 x IPv4  
KVM  
Ubuntu 22

EDIT: oh whoops, weren’t sure if replying to me or Robert

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 6, 2024, 3:33pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/9 "2024-04-06T15:33:35Z")

</div>

> [@eisammy](#):
>
> High-Traffic?

Low enough for the site to remain very responsive at all times.

4GB/3 vcores + 2GB Swap.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [April 6, 2024, 3:44pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/10 "2024-04-06T15:44:59Z")

</div>

CDN helps a bit if there is a lot of global audience, and/or VPS is behind a low end server. And PHP-based sites may get a bit better improvment but good caching policy helps more.

Nature of Discourse has tendency break such improvements, or if wanted to say that way: it doesn’t need such helps.

Those metric services have plenty of issues and quite seldom these can be read ”as is” tips.

---

<div class="post-metadata">

### Author: ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)
#### Post date: [April 6, 2024, 3:47pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/11 "2024-04-06T15:47:55Z")

</div>

> [@45thj5ej](#):
>
> The biggest JS files slowing the site down are:
> 
> > [https://forums.gonomad.me/assets/chunk.2c7ac65fdfc1f35c61b6.d41d8cd9.js](https://forums.gonomad.me/assets/chunk.2c7ac65fdfc1f35c61b6.d41d8cd9.js)  
> > [https://forums.gonomad.me/assets/locales/en-d255b87afa1b13a48418c34b7c45d8aa69fce223261f36c9a101fb022c7cb8e5.js](https://forums.gonomad.me/assets/locales/en-d255b87afa1b13a48418c34b7c45d8aa69fce223261f36c9a101fb022c7cb8e5.js)
> 
> But again, I think that’s something baked into Discourse?

Yeah, that’s what I’m a little confused about. Basically all of the points I’m being dinged on seem like they’re baked into Discourse (long JS load times/blocking, etc) + maybe a combination of my theme, so does that just mean a Discourse site will never have a good score on these, lol? I kinda doubt that, though. Forums, specifically.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [April 6, 2024, 3:57pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/12 "2024-04-06T15:57:11Z")

</div>

> [@45thj5ej](#):
>
> just mean a Discourse site will never have a good score on these

It means that. You can help little taking away some (unnecassary) functionalities, mainly by plugins, but… there isn’t any real benefits.

Good news are it just doesn’t matter at all. And your users’ internet service and devices are bigger bottle neck.

If you have too much spare time you can start dev this, that and something else and all you get is perhaps a second off from here and another from there — and those spares are measurable only by lab tests.

Let the team and plugin/theme devs do theirs job. That’s enough.

If you have a WordPress, Drupal etc ”real” web platform there would be a ton different tricks to do. Now the solution is fundamentally different.

And sure — I’m just another home cooked admin/webmaster and will stand corrected if I’m wrong. But I’m not 🤣

---

<div class="post-metadata">

### Author: ![45thj5ej](https://avatars.discourse-cdn.com/v4/letter/4/34f0e0/32.png) [@45thj5ej](https://meta.discourse.org/u/45thj5ej)
#### Post date: [April 6, 2024, 4:10pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/13 "2024-04-06T16:10:39Z")

</div>

Ok, yeah, I just ran the same tests on a default brand new theme with no components on it and got:

 ![vvvv](https://global.discourse-cdn.com/meta/original/4X/8/3/9/839db08cef7f8cead07ba33e2eeea0813d3f9624.png)

It seems blocking time is always the top issue (for me at least when I run these). So, I guess Discourse devs need to optimize it better or? Genuinely asking, not trying to diss.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [April 6, 2024, 4:39pm UTC](https://meta.discourse.org/t/optimizing-site-for-speed-how-to-improve/302671/14 "2024-04-06T16:39:29Z")

</div>

This is not what a human sees. Again: Discourse is a web app that first moves necessary files and after that everything is (almost) just json-text. That test works, somehow, when a website generates pages at server level and sends readable html to client. Like what WordPress does.

And that time is not bad, at all.

What you are now suggesting is Discourse should be full app and not usable via browsers, for example.
