Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serving static files from Amazon S3

What is better for serving static files of most websites (javascripts, css, images, html): S3, something like EC2 or yet another option?

like image 634
Rafał Sobota Avatar asked Jan 03 '11 17:01

Rafał Sobota


People also ask

How static files are served in AWS?

In the navigation pane, choose Configuration. In the Software configuration category, choose Edit. In the Static files section, enter a path for serving static files and the directory of the static files to serve into the empty row at the bottom of the list.

Can you use S3 as a file server?

Use Amazon S3 as a cloud file server with secure access and file sharing. It is a solution with web browser access, mapped drive access, file locking, version control, and sharing files online as web links.

Is this possible to run static websites from Amazon S3?

If you want to use HTTPS, you can use Amazon CloudFront to serve a static website hosted on Amazon S3. For more information, see How do I use CloudFront to serve HTTPS requests for my Amazon S3 bucket? To use HTTPS with a custom domain, see Configuring a static website using a custom domain registered with Route 53.

Which S3 feature can be used to host static website?

To enable static website hosting Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to enable static website hosting for. Choose Properties. Under Static website hosting, choose Edit.


1 Answers

S3 with CloudFront enabled would be my choice; then you get the benefits from S3, plus fast access for your users through their edge-locations.

If you have some really high performance demands, you should look into something that is physically located near your users. In my case, swedish providers are a bit faster than any of Amazons solutions (but usually not as nice to use).

EC2 is not really made for static files (or rather, it's made for so much more).

like image 179
Jakob Avatar answered Oct 06 '22 00:10

Jakob