# CloudFront not caching static files

**URL:** <https://meta.discourse.org/t/cloudfront-not-caching-static-files/109818>\
**Category:** Self-hosting\
**Created:** [22 בפברואר,‏ 2019,‏ 12:43pm UTC](https://meta.discourse.org/t/cloudfront-not-caching-static-files/109818 "2019-02-22T12:43:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)\
**Post date:** [22 בפברואר,‏ 2019,‏ 1:02pm UTC](https://meta.discourse.org/t/cloudfront-not-caching-static-files/109818/2 "2019-02-22T13:02:31Z")

</div>

You’re doing it wrong!

You need to split the container into Data and Web or you can use RDS for Postgresql to host data and load-balance among the web containers.

~~Also, It is not recommended to use cloudflare optimizations as they cause many issues.~~

> [@soke](#):
>
> DISCOURSE\_CDN\_URL: [https://civicxclub.com](https://civicxclub.com)

And You need to set up your cloudfront URL in the discourse CDN field not the name of the server.

---

_[View the full topic](https://meta.discourse.org/t/cloudfront-not-caching-static-files/109818)._
