How to solve super slow loading time for site?

Was spending a long time optimizing my CSS, removing plugins, removing redirects, everything I can to improve load times but apparently the main culprits are:

mobile_4-randomcharacters-.css, which contains normalize.css and Pikaday and loads at 1.5 seconds on mobile
and /assets/ember_jquery-randomcharacter-.js which loads in 3.6 seconds on mobile

I have no idea what to do about these files, which having the highest loading time.

Desktop loading is faster, but not great.
Server is on 1 CPU 2 GB RAM 50 GB SSD 2 TB bandwidth on a professional US based server
2 unicorn workers, neither CPU nor RAM are under heavy load, and I dont have many users or plugins
Any ideas? thanks

Measured using

1 Like

Those are static assets, and to optimize delivery of those you should Enable a CDN for your Discourse


thank you, PageSpeed Insights says the CPU time (not delivery time) specifically for the second asset was almost 4 seconds, will a CDN like fastly still help with that? I currently use cloudflare with caching, is there a tweak on cloudflare I should use or just add something like fastly on top?!

That is indeed a big asset that will take time to parse and evaluate. As Discourse is a “Single Page Application” that cost is all paid upfront when the user first arrive, and this is a trade-off of our the approach, which is focused on making all the subsequent interaction, typical of forum usage, lightweight.

There are plan for EmberJS to drop mandatory JQuery, which will reduce this payload a fair bit, but we are years away of making this transition in Discourse.

1 Like

thanks for the response, I think something must be off with my configuration, as i have never heard anyone else reporting those load times

Well, the pagespeed defaults force a Nexus 5X and a 3G connection, which even for Brazil (a third world country) is on the low end for today standards, so real world performance will depend on that.

1 Like