Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I remember reading somewhere that there was a serious pitfall to using Amazon S3 for hosting a static website. I forgot what it was though. To me, S3 seems like a perfect option. Super fast, super scalable, and pay as you go.

What are the negatives of using S3 to host a static website?

share|improve this question

I'm still shocked to read that people assume that Content Delivery Networks are expensive, most charge as little as 0.20c per a GB.

Serving static websites on CDN's is amazing - you get the performance of a dedicated server without actually paying for it, plus you have a server in all major regions around the world so effective its actually better than a dedicated server for speed and scalability.

There is a few major set backs when hosting on CDN's and these are:


PHP Support (You'd need to use contact forms via AJAX to retieve a contact.php from else where, html methods suck - if you don't need a contact form then AWESOME! for things like comments you can use DISQUS which is Javascript.


Sadly most CDN's don't support non-www cname so you can't resolve the domain when someone forgets the www, not a major problem but there are ways around this. You setup a EC2 or shared hosting and you let it handle the non-www with a redirect. So whenever someone forgets the www it communicates with the server then redirects to the CDN correctly. Alternative method is that you pick a CDN which supports this - I believe limelight does but Amazon, and Rackspace do not. I've heard limelight hosting the DNS and making edits manually on their system, I've never done this myself so cant confirm they do or do not.

Content Updating

The other set back is that you need to purge the content or files that your editing, so say for example you make some additions to the index.html you'd need to either setup a short expire on the container or manually purge that file from the cache so it updates all over the world.


Hosting a static site on a CDN is fanstatic - I run a handful of static sites on CDN and they are fanstatic, I only use like 1-2GB on each site and I get bills for £0.24p for each site, which is cheaper than shared hosting, and gives you the proformance of a dedicated server. If your going to setup a small VPS other than a EC2 for the redirect any VPS that is 128mb will do it. You can get a cheap one for like $1 a month. Just Google 128mb VPS or VPS under $5 a month - theres hundreds of companies doing LOW SPEC VPS for peanuts which will do the trick.

share|improve this answer
Cloudflare doesn't have issues with non-www cname. Plus the free tier is not bad either – elssar Jan 28 '13 at 1:52
Amazon has a dns service called Route 53 that could be used to route the tld to the www subdomain. – gang Aug 15 '14 at 9:47
Specifically AWS Route 53 has ALIAS records where you put in another host name (like you do with a CNAME), but the DNS server does the lookup periodically (seconds) and serves the record with the IP address (A record). – Stephen Ostermiller Jan 26 at 21:27

The problem is in the "pay as you go" part.

If you get tons of traffic (ie: a DOS attack or a very popular blog post or file) you will PAY for it.

AFAIK there isn't still a feature to put a cap to what you pay. You can set billing alerts, but if your billing reaches your maximum budget the only option you have is to shut the site down or you will pay for all the traffic you get.

share|improve this answer

It's actually a bit overpriced in terms of bandwidth. They also had, until very recently, an issue were you couldn't map both your @ and your www A record to your site (so you either had mydomain.com accessible, or www.mydomain.com accessible). This however was fixed in a very recent update.

Personally, I think they're a bit overpriced, and you are lacking a lot of nice features (redirects, htaccess, etc). S3 does work well for hosting large files and images though.

share|improve this answer

S3 isn't meant to be the ONLY tool from AWS for static website hosting. The recommended approach is to put CloudFront in front of the S3 instance so that CloudFront can handle caching. I believe this will also eliminate your issue with paying a bunch for an increase of traffic since CloudFront will use it's cache to serve the files and not hit S3. Of course, you're having to pay for CloudFront, but the cost will be less (I think).

Here is an article about this adding CloudFront to your S3 site:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.