How to setup cloudfront for discourse

@Magnetidog I just got it to work.

I basically created the AWS Cloudfront distribution as explained in this video.

Then, I went to the admin panel and added my Cloudfront URL to the s3 cdn url key.

Then, I entered the container and rebaked all posts with rake posts:rebake (it took me around 10 min for every 7000 posts).

I also tried doing it in batches in the Rails Console, but for some reason this didn’t work: Post.in_batches.update_all('baked_version = NULL') (nothing happened 🤷🏻‍♂)

5 Likes