AWS S3 + Static Files: Change the Game
S3 with CloudFront serves your site from edge locations worldwide for pennies. Traditional hosting charges $30 per month for a shared server in one data center. The math is not close.
AWS S3 + Static Files
Change the Game
Static Hosting Done Right:
S3 was designed as object storage, but its static website hosting feature is one of the most underrated services in AWS. Upload HTML, CSS, JavaScript, and image files to a bucket. Enable static website hosting. Point your domain at it through Route 53. You now have a website that is hosted on AWS's globally distributed infrastructure, scales to handle any traffic spike without intervention, and costs cents per month for most business sites. There is no server to patch. No PHP version to upgrade. No WordPress plugin to secure. The attack surface is the files themselves.
Put CloudFront in front of the S3 bucket and the math gets even better. CloudFront caches your files at over 400 edge locations worldwide. A visitor in Tokyo hits a server in Tokyo. A visitor in London hits a server in London. Your origin bucket in us-east-1 only serves each file once per cache cycle. The result: page load times under 100ms globally, zero server configuration, and a hosting bill that rarely exceeds $3 per month for a typical business site. We have clients whose monthly AWS bill is less than a single month of their previous GoDaddy shared hosting plan.
Beyond Hosting: S3 as Asset Infrastructure:
Static site hosting is just one use case. S3 handles file uploads for web applications: user profile images, document attachments, invoice PDFs, media libraries. Pre-signed URLs let you generate temporary, secure upload links that expire after a configurable duration. The client uploads directly to S3 without routing the file through your application server, which means your API does not bottleneck on large file transfers. The pre-signed URL pattern is simple: your API generates a signed URL with PutObject permission, the client uses it to upload, and S3 handles the storage.
Versioning protects against accidental deletions and overwrites. Enable versioning on a bucket and every object maintains a full history. Delete a file and it gets a delete marker; the previous version is still recoverable. Overwrite a file and both versions are stored. Lifecycle policies automate cost management: transition objects to S3 Infrequent Access after 30 days, to Glacier after 90 days, and delete old versions after 365 days. This tiered approach means you pay full price only for files that are actively accessed.
Our Deployment Pipeline:
Every static site we deploy follows the same pipeline. The Next.js build outputs static files to the out/ directory. A GitHub Actions workflow runs on push to main: it builds the project, runs linting and type checks, syncs the output to the S3 bucket using aws s3 sync with the --delete flag to remove stale files, and creates a CloudFront invalidation to clear the CDN cache. The entire process takes under three minutes from git push to live on production.
We configure S3 bucket policies to block all public access except through the CloudFront distribution. The bucket itself is not publicly accessible; CloudFront uses an Origin Access Identity to read from S3 on behalf of visitors. This means there is no way to access your files by guessing the S3 bucket URL directly. HTTPS is enforced through CloudFront with a free ACM certificate. HTTP requests redirect to HTTPS automatically. Security headers (Content-Security-Policy, X-Frame-Options, Strict-Transport-Security) are added via CloudFront response headers policy.
The Cost Comparison:
Traditional shared hosting: $10 to $30 per month for a server in one location that you share with hundreds of other websites. Performance degrades when your neighbors get traffic. You are responsible for updates, backups, and security patches. Uptime is best-effort. A managed WordPress host: $25 to $100 per month with better performance but still a single geographic region and a running server that needs maintenance.
S3 + CloudFront: $1 to $5 per month for global CDN distribution, automatic scaling, no server maintenance, and 99.99% availability backed by AWS's SLA. The cost per GB of storage is $0.023. The cost per 10,000 GET requests is $0.004. A site that serves 100,000 page views per month costs under $2 in S3 and CloudFront charges. The annual savings compared to traditional hosting pay for the engineering time to set up the pipeline in the first month. After that, it is pure savings compounding every year.