# Avatar Offloading to S3

**URL:** <https://meta.discourse.org/t/avatar-offloading-to-s3/46406>\
**Category:** Feature\
**Created:** [24 Giugno 2016, 3:44pm UTC](https://meta.discourse.org/t/avatar-offloading-to-s3/46406 "2016-06-24T15:44:06Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jongnam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jongnam/32/52330_2.png) [@jongnam](https://meta.discourse.org/u/jongnam)\
**Post date:** [28 Giugno 2016, 12:24am UTC](https://meta.discourse.org/t/avatar-offloading-to-s3/46406/5 "2016-06-28T00:24:29Z")

</div>

Thanks for the note, I could image how complex it would be to serve multiple resolutions of avatar. It would much simpler to service via NGINX as you explained so that NGINX can generate thumbnails on the fly while the CDN caches the file to the edge. The combination of NGIX thumbnail generation and CDN will be the easy way to implement and I cannot agree more at this moment. But yet it does not answer the data durability question. If the NGINX server is the first tier storage of avatar, there is still a risk of data loss which happened to my application in a week back.

What if NGIX stores the avatar original images into S3 and fetch the files on demand? If the NGINX stores and fetches avatar original images from S3, then Discourse can keep using the existing avatar implementation whilst ensuring the data durability. For example, it can still use [cdn.discourse.org](http://cdn.discourse.org) as the endpoint and pointing to NGINX as origin. In case that the NGINX was terminated or lost avatar thumbnails, it can fetch the original images from S3 on demand and does not need to worry about data loss.

---

_[View the full topic](https://meta.discourse.org/t/avatar-offloading-to-s3/46406)._
