# 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:** 7

<div class="post-metadata">

**Author:** ![soke](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@soke](https://meta.discourse.org/u/soke)\
**Post date:** [25 בפברואר,‏ 2019,‏ 4:17pm UTC](https://meta.discourse.org/t/cloudfront-not-caching-static-files/109818/7 "2019-02-25T16:17:09Z")

</div>

> [@Falco](#):
>
> DISCOURSE\_CDN\_URL should be different from the DISCOURSE\_HOSTNAME. Use a dedicated URL for the CDN

How can I then serve avatars, css and js files from this CDN if they are stored on the server??  
I’ve tried to use the [cdn.civicxclub.com](http://cdn.civicxclub.com) url which is mapping to the S3 bucket and add all the behaviours related to discourse static content, and it failed.

---

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