What is better for serving static files of most websites (javascripts, css, images, html): S3, something like EC2 or yet another option?
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.
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.
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With