Optimizing Site For Speed - How To Improve?

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.

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/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?

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/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:

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

I would look at the hosting environment instead. :thinking:

The result looks fine to me, though

1 Like

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

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?)

Set up a CDN is always a good start. :rocket:

2 Likes

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

1 Like

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.

3 Likes

High-Traffic? Could tell me his server config?

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

1 Like

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

4GB/3 vcores + 2GB Swap.

2 Likes

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.

1 Like

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.

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 :rofl:

1 Like

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

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.

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.