Optimise speed - js and images

AI-generated summary

The discussion revolves around optimizing speed in Discourse, focusing on JavaScript and images. Initially, steven_so inquires about combining multiple JavaScript files and highly reused images using CSS sprites. sam explains that with the official Discourse installation and SSL enabled, HTTP/2 is used, making sprites and other hacks unnecessary.

steven_so is surprised to learn that HTTP/2 comes by default and wonders why there’s a mix of HTTP/1.1 and HTTP/2 requests, to which Falco responds that the apparent HTTP/1.1 requests are resources coming from cache.

Regarding page optimization and server-side settings, steven_so asks for resources, and Remah suggests searching for scalability discussions and provides a link to a relevant post on performance, scaling, and HA requirements. steven_so also expresses interest in learning about the engineering and scalable decisions made by the Discourse team.

Hi,

I’m wondering if there is any feature that combines all/multiple javascripts into one and highly reused images using css sprint?

I do see it takes bit of time to load the website during the first time and then is very fast from second load onwards.

Any recommendation?

If you are using our official install and have SSL enabled (eg access your site with https://yoursite.com) then you get HTTP/2

This means we send all the assets more efficiently and that sprites for avatars and various other hacks that were needed in the HTTP/1.1 era are no longer beneficial.

Ah yea I understand. Never thought http2 comes by default with the discourse DO image/installation script.

I’m not an advance in this tech stack, I did wonder why there is a mix of h1.1/h2 request. Is it a browser choice?

Also, to reduce the time for first page load, is there a topic/discussion here about page optimisation/cdn/server side settings to read about specifically for discourse?

I have 7 to 10 seconds loads time in a private window and it’s a vanilla setup and a small forum.

Also, If there is a blog/category section, I would love to read about engineering/scalable decision that the discourse team made while building the forum.

You can search on scaling and scalability using the magnifying glass above. :wink:

You can also find links to codinghorror’s blog from posts he shares here in the #site-feedback:blog subcategory .

This is a really useful post on a related topic that you might miss:

If you pay attention to your print screen you will see the lines showing HTTP1.1 aren’t real requests, but just resources coming from cache.

thanks all :grinning: