# User avatars not in S3 but served via discourse\_cdn\_url

**URL:** <https://meta.discourse.org/t/user-avatars-not-in-s3-but-served-via-discourse-cdn-url/160920>\
**Category:** Development\
**Created:** [August 14, 2020, 7:17pm UTC](https://meta.discourse.org/t/user-avatars-not-in-s3-but-served-via-discourse-cdn-url/160920 "2020-08-14T19:17:39Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

In a discussion regarding Discourse configuration, [Terrapop](/t/-/160920/1) inquired why user avatars were being served via the origin CDN (`DISCOURSE_CDN_URL`) rather than the S3-backed upload CDN (`DISCOURSE_S3_CDN_URL`), despite having S3 enabled for backups and uploads. [Falco](/t/-/160920/2) clarified that this behavior is correct, explaining that avatars, stylesheets, and theme JavaScripts are still served from the application via `DISCOURSE_CDN_URL`. While moving these assets to the S3 CDN is a long-term goal, it involves significant complexity trade-offs. [Terrapop](/t/-/160920/3) acknowledged the explanation and confirmed that the setup is functioning as intended.

<div class="post-metadata">

**Author:** ![Terrapop](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Terrapop](https://meta.discourse.org/u/Terrapop)\
**Post date:** [August 14, 2020, 7:17pm UTC](https://meta.discourse.org/t/user-avatars-not-in-s3-but-served-via-discourse-cdn-url/160920/1 "2020-08-14T19:17:39Z")

</div>

While setting up our S3 cached with CloudFront, and origin assets cached with via another CloudFront subdomain, I saw that the user avatars are still hosted and served via [https://cdn-origin.xxxxx.com](https://cdn-origin.xxxxx.com).

Is this correct, or should they not also uploaded and delivered via cdn-uploads from the S3 bucket?

```plaintext
  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: us-east-1
  DISCOURSE_S3_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXXXXXXXX
  DISCOURSE_S3_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  DISCOURSE_S3_CDN_URL: https://cdn-uploads.xxxxx.com
  DISCOURSE_S3_BUCKET: xxxxx-uploads
  DISCOURSE_S3_BACKUP_BUCKET: xxxxx-backup
  DISCOURSE_BACKUP_LOCATION: s3
  DISCOURSE_CDN_URL: https://cdn-origin.xxxxx.com

```

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [August 14, 2020, 7:20pm UTC](https://meta.discourse.org/t/user-avatars-not-in-s3-but-served-via-discourse-cdn-url/160920/2 "2020-08-14T19:20:35Z")

</div>

Avatars, Stylesheets, Javascripts for themes and others are still served from the app, so they are served via `DISCOURSE_CDN_URL` and not via `DISCOURSE_S3_CDN_URL`.

Moving some of those to `DISCOURSE_S3_CDN_URL` is a long term goal, but there are trade-offs in complexity.

---

<div class="post-metadata">

**Author:** ![Terrapop](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Terrapop](https://meta.discourse.org/u/Terrapop)\
**Post date:** [August 14, 2020, 7:21pm UTC](https://meta.discourse.org/t/user-avatars-not-in-s3-but-served-via-discourse-cdn-url/160920/3 "2020-08-14T19:21:30Z")

</div>

Understood, thanks for confirming that all is working as it should then.
