- Mais recentes
- Mais votos
- Mais comentários
Based on your description, you're experiencing latency issues when serving content directly from your S3 bucket in the sa-east-1 region. This is a common challenge when distributing large files like game assets.
The main factors affecting page load latency include:
- Round-trip delay for establishing TCP connections
- Time for S3 to retrieve and serve content
- Time for content to travel across the internet to users
- Browser parsing and display time
Most of the delay comes from factors 1 and 3 - the TCP handshake and the time it takes for packets to travel across internet distances.
Here are recommendations to improve your situation:
-
Implement Amazon CloudFront: This is highly recommended as your primary solution. CloudFront is a content delivery network that will cache your content at edge locations closer to your users, significantly reducing latency. Even though your bucket is in São Paulo, users in different parts of South America would benefit from CloudFront's distributed edge locations.
-
Configure Origin Access Control (OAC): When setting up CloudFront, use Origin Access Control to ensure users access your content through CloudFront rather than directly from S3. This includes:
- Setting up OAC for your CloudFront distribution
- Updating your S3 bucket policy to only allow access from your CloudFront distribution
- Enabling "Block all public access" on your S3 bucket
- Providing users with the CloudFront URL instead of the S3 URL
- Consider S3 Transfer Acceleration: If you need to optimize uploads to your bucket or if you have users far from South America, S3 Transfer Acceleration can help. It routes traffic through Amazon CloudFront's globally distributed edge locations and uses optimized network protocols. This is particularly useful for transferring large objects over long distances.
For your specific use case with a game-sized application targeting South American users, CloudFront would be the most effective immediate solution to reduce latency and improve the user experience.
Sources
Evolving the architecture with Amazon CloudFront - Hosting Static Websites on AWS
S3 Transfer Acceleration
Use Amazon S3 Transfer Acceleration to Minimize Latency Caused by Distance - Best Practices Design Patterns: Optimizing Amazon S3 Performance
Need Help in connecting S3 bucket with cloudfront | AWS re:Post
