- Newest
- Most votes
- Most comments
Based on your setup in the Asia Pacific (Singapore) region, you're experiencing intermittent latency spikes during peak hours with your S3-hosted static website. This is a common issue with direct S3 hosting, especially when serving content to users who are geographically distant from your bucket's region.
While your current configuration with public read access is correctly set up for basic static website hosting, it doesn't address the latency concerns. The latency issues you're experiencing are likely due to:
- Round-trip delay in establishing TCP connections between users and the S3 bucket
- The time it takes for packets to travel across long internet distances
- TCP handshake overhead (which can account for 10-30% of the latency)
For optimizing load times, I would strongly recommend implementing Amazon CloudFront in front of your S3 bucket. CloudFront would provide several key benefits:
- Content would be cached at edge locations closer to your users, significantly reducing latency
- TCP connections would be established with nearby edge locations rather than directly with the Singapore region
- CloudFront provides additional security features and can help handle traffic spikes
Your current direct S3 link approach is sufficient for low to moderate traffic from users near the Singapore region, but it won't provide optimal performance for users in other geographic locations. CloudFront would help stabilize your connection and provide more consistent performance regardless of user location.
Additionally, CloudFront would maintain your public read access while adding a layer of protection and performance optimization. The investment in setting up CloudFront is minimal compared to the performance benefits you'll gain, especially during peak hours when you're currently experiencing latency spikes.
Sources
Evolving the architecture with Amazon CloudFront - Hosting Static Websites on AWS
Hello.
If you plan to use a custom domain to enable HTTPS in the future, I recommend using CloudFront.
Using CloudFront also allows for caching, which can reduce costs slightly by reducing API requests to S3.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/optimizing-performance.html
