<p>S3 is not itself a CDN, no.  However, you can use Cloudflare as a free and very easy to set up CDN service in front of it.</p>

<p>For me the main advantages of S3 are that it's a centralised repository of assets I can point all my environments to (so dev, staging, production all point to the same S3 and thus have identical assets available to them with no need to sync anything).  I trust Amazon to runs servers more than I do individual other companies, simply by virtue of their size and experience (and I know some of the engineers as well - they're smart people!).</p>

<p>With Cloudflare in front of S3, you get CDN and static asset caching benefits, and images are served <em>very</em> quickly.</p>

CC BY-SA 3.0
2016-06-16T07:29:39.460Z
Also if you need to move your site to a new server quickly for whatever reason or emergency; having all your images on S3, separate from your site makes the process much smoother since you don't have to move them also.
AbbeyDesign
CC BY-SA 3.0
2016-06-16T11:23:12.070Z
Be very careful sharing a single S3 bucket across environments - actions in dev/staging can result in files being moved around or deleted in production!
Mike Pepper
CC BY-SA 3.0
2016-06-16T11:27:31.443Z
Well yes, that's the point :)  the idea is to keep them deliberately in sync. (Our dev is for us, I guess with clients you might approach differently but even there generally working with one asset pool makes a lot of sense I'd think?)
Jeremy Daalder
CC BY-SA 3.0
2016-06-16T16:46:04.467Z
@JeremyDaalder - I like the Cloudflare + S3 idea a lot. Is there anything special I have to do to make them play nice together? Cloudflare setup looks super simple, and I've setup S3 before.
4midori
CC BY-SA 3.0
2016-06-16T23:17:10.147Z
No it's pretty simpler really.  Only real gotcha is you can't use cname records with your s3 bucket for nicer names as you'd need a legit SSL on the S3 bucket (which means cloudfront at $600/mth I believe!) - so you either have to use 'flexible ssl' on cloudflare (which seems a bit of a con) or stick with the default non cnamed URLs for your files and use strict ssl on cloudflare (and legit certs on all your servers obviously).  basically so long as you cn live with non pretty urls for static assets, it's all super easy.
Jeremy Daalder
CC BY-SA 3.0
2016-06-17T16:46:36.267Z
@JeremyDaalder Sounds like you know this well. Assuming we can do this without an SSL cert, could we have a quick chat about you helping with setup? Email bas(((at))versastudio(*)com.
4midori
CC BY-SA 3.0
2016-07-06T14:55:18.753Z
@JeremDaalder personally I would never share an S3 bucket between dev and production especially.

As soon as any Asset is deleted, during any testing or development, by anyone working on the site on their own machine, whether accidentally or on purpose, then that image would disappear from the production site too (the AssetFileModel would still exist, just broken).

It's a bit of a pain to duplicate buckets to other environments, but sharing seems way too dangerous to me, I should be able to do anything in my development environment without worrying about it affecting the live site.
Mike Pepper
CC BY-SA 3.0
2016-07-06T23:41:07.497Z
All depends on your dev approach and size of team really, I guess.  I personally like to keep Dev as close a possible, but I'm a team of one plus a few irregular helpers, so I don't really carry that risk.

You're talking about deleting directly on S3 though right?  As long as they delete in the CP, Craft would clean up appropriately.
Jeremy Daalder
CC BY-SA 3.0
2016-06-16T00:30:34.177Z
2016-06-16T08:25:43.973Z
2016-06-16T08:25:43.973Z
Jeremy Daalder
<p>Starting a substantial project. There will be 100s of images on the site. Few are part of the general design, but there are slide carousels, photos, etc.</p>

<p>I understand what S3 is, but I'm wondering what the specific value is of using it over local storage. There is plenty of room on the web host's server. </p>

<p>S3 isn't a CDN, right? Or will it replicate files across to other locations?</p>

<p>Should I expect S3 to be faster than local storage? And is my S3 bucket backed up elsewhere, should Amazon's servers crash?</p>

<p>Thanks.</p>

<assets><s3><hosting>
What is the value of hosting assets on Amazon S3? Best practices question
# What is the value of hosting assets on Amazon S3? Best practices question

(Asked by: username_0 on 2016-06-16)

Starting a substantial project. There will be 100s of images on the site. Few are part of the general design, but there are slide carousels, photos, etc.

I understand what S3 is, but I'm wondering what the specific value is of using it over local storage. There is plenty of room on the web host's server.

S3 isn't a CDN, right? Or will it replicate files across to other locations?

Should I expect S3 to be faster than local storage? And is my S3 bucket backed up elsewhere, should Amazon's servers crash?

Thanks.

**Tags:** assets, s3, hosting


---

## 1 answers

### Answer by username_1 on 2016-06-16. Score: 4 | Accepted answer

S3 is not itself a CDN, no. However, you can use Cloudflare as a free and very easy to set up CDN service in front of it.

For me the main advantages of S3 are that it's a centralised repository of assets I can point all my environments to (so dev, staging, production all point to the same S3 and thus have identical assets available to them with no need to sync anything). I trust Amazon to runs servers more than I do individual other companies, simply by virtue of their size and experience (and I know some of the engineers as well - they're smart people!).

With Cloudflare in front of S3, you get CDN and static asset caching benefits, and images are served *very* quickly.

> **Comments:**
> **username_2**: Also if you need to move your site to a new server quickly for whatever reason or emergency; having all your images on S3, separate from your site makes the process much smoother since you don't have to move them also.  
> **username_3**: Be very careful sharing a single S3 bucket across environments - actions in dev/staging can result in files being moved around or deleted in production!  
> **username_1**: Well yes, that's the point :)  the idea is to keep them deliberately in sync. (Our dev is for us, I guess with clients you might approach differently but even there generally working with one asset pool makes a lot of sense I'd think?)  
> **username_0**: @JeremyDaalder - I like the Cloudflare + S3 idea a lot. Is there anything special I have to do to make them play nice together? Cloudflare setup looks super simple, and I've setup S3 before.  
> **username_1**: No it's pretty simpler really.  Only real gotcha is you can't use cname records with your s3 bucket for nicer names as you'd need a legit SSL on the S3 bucket (which means cloudfront at $600/mth I believe!) - so you either have to use 'flexible ssl' on cloudflare (which seems a bit of a con) or stick with the default non cnamed URLs for your files and use strict ssl on cloudflare (and legit certs on all your servers obviously).  basically so long as you cn live with non pretty urls for static assets, it's all super easy.  
> **username_0**: @JeremyDaalder Sounds like you know this well. Assuming we can do this without an SSL cert, could we have a quick chat about you helping with setup? Email bas(((at))versastudio(*)com.  
> **username_3**: @JeremDaalder personally I would never share an S3 bucket between dev and production especially.  As soon as any Asset is deleted, during any testing or development, by anyone working on the site on their own machine, whether accidentally or on purpose, then that image would disappear from the production site too (the AssetFileModel would still exist, just broken).  It's a bit of a pain to duplicate buckets to other environments, but sharing seems way too dangerous to me, I should be able to do anything in my development environment without worrying about it affecting the live site.  
> **username_1**: All depends on your dev approach and size of team really, I guess.  I personally like to keep Dev as close a possible, but I'm a team of one plus a few irregular helpers, so I don't really carry that risk.  You're talking about deleting directly on S3 though right?  As long as they delete in the CP, Craft would clean up appropriately.  

---

