Mobile app version of vmapp.org
Login or Join
Sent6035632

: Why shouldn't I use Amazon S3 for hosting a static webpage I remember reading somewhere that there was a serious pitfall to using Amazon S3 for hosting a static website. I forgot what it was

@Sent6035632

Posted in: #AmazonS3 #WebHosting

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?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Sent6035632

4 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

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:
docs.aws.amazon.com/gettingstarted/latest/swh/getting-started-create-cfdist.html

10% popularity Vote Up Vote Down


 

@Cugini213

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.

10% popularity Vote Up Vote Down


 

@Speyer207

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 CDNs 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 are a few major setbacks when hosting on CDNs, and these are:

No PHP files

PHP support (You'd need to use contact forms via Ajax to retrieve a contact.php from elsewhere, HTML methods suck – if you don't need a contact form, then (awesome!) for things like comments you can use Disqus, which is JavaScript.)

CNAME issues

Sadly most CDNs don't support non-www CNAMEs 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. An 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 I can't 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.

Summary

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 performance 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 a month. Just Google 128mb VPS or VPS under a month - there's hundreds of companies doing low spec VPS for peanuts which will do the trick.

10% popularity Vote Up Vote Down


 

@Speyer207

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 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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme