How to add AWS Cloudfront as a Discourse CDN

AI-generated summary

jimmy0017 wants to add AWS Cloudfront as a CDN to their Discourse site to improve performance. They have already moved objects like images to AWS S3, but are having trouble setting up Cloudfront as the DISCOURSE_CDN. Lilly suggests checking the official documentation, specifically this topic and this one. However, jimmy0017 is unsure about the setup, particularly the instruction to not configure DISCOURSE_CDN_URL. supermathie clarifies that DISCOURSE_S3_CDN is for S3 CDN, while DISCOURSE_CDN is for the app CDN, which jimmy0017 wants to utilize for a full app CDN. jimmy0017 has already configured S3 with Cloudfront for uploads, but is trying to cache more assets like user avatars.

We’ve moved the objects (such as image, and others) to AWS S3. Those have been great.

Now we want to speed up the site a bit more. How should I add the AWS cloudfront as the DISCOURSE_CDN?

I tried to setup myself. It works when I am using the forum-cdn. But as soon as I put the url into the discourse_cdn, the site becomes unusable and all images are having multiple redirects and stopped working.

Did you have a look through the documentation here:

also

Yap! I used this one as the way to setup.

But the second post contains which i am not sure if it is the official setup. And the post was from 2021.

Do not configure “DISCOURSE_CDN_URL”

Everything you need should be here, starting with this topic

I’ve already done this. The image of our site is on AWS S3 with cloudfront. I am trying to cache more such as the user_avatar image instead of hitting the server.

The S3 CDN should be DISCOURSE_S3_CDN.

DISCOURSE_CDN is for the app CDN

I understand this part. I am trying to add a full app CDN for the site. So i would like to utilize DISCOURSE_CDN.