Discourse SSL setup

I was seeing a TTFB of 5.5 seconds here. If I open Chrome’s developer tools and refresh the page with caching disabled, it takes up to 26 seconds to load the main discourse page fully from scratch, which is a 5.3 MB download spread across 31 requests.

I’ve spent a couple of hours tweaking Nginx’s config file. It now caches any requests for images so Discourse doesn’t have to deal with them, and adds expires headers to them. I also enabled level 9 gzip compression on all css, js and htm files, which reduced the total size of the home page to 3.3 MB. Then, I noticed a whole bunch of .map files (no idea what they’re for) were being downloaded on the home page, so I told Nginx to also compress these. Now, the home page takes 1.3 MB to fully download.

Oh, and I also recompressed our site asset png images with super tight compression.

(if we have load issues, we could look at turning the gzip down from level 9 to something more like level 7).

15 seconds is still quite a long time for a new visitor to wait…