0
votes

I have built a SaaS platform that allows users to up- and download large files and preview files before buying them. The files are hosted on S3 and the core app/platform on EC2. I would like to speed up the platform with Cloudfront (and also apply to get a free SSL certificate from AWS with Cloudfront) but am not sure if then all files (also the large download files) would be served via Cloudfront.

The platform on EC2 would probably benefit from CF as its audience is global but I don't want media files and large downloads which are hosted on S3 to be served through Cloudfront. Is this possible to achieve? And do I need CF at all? I have few experience with AWS.

1
"I don't want media files and large downloads which are hosted on S3 to be served through Cloudfront." This statement leads me to believe there are things you don't understand about CloudFront. Why would you not want this?Michael - sqlbot
Cloudfront is the only way to have https for s3 on a custom domain. If you're ok with pulling s3 content from an Amazon domain, you can do so with the same security on an unbranded domain.Daniel Farrell
So are you saying its possible to leave out big download files (ZIP) and only share the other content EC2 + Images from S3? My main concern is costs. Don't want to end up in huge costs due serving huge download files. Thanks!createawesomestuff
@michael: i know CF helps to distribute files such as images, audio files etc. from S3 faster, but when you serve digital download files (ie. 2GB,ZIP) there is not much need nor speed difference for buyers downloading ZIP files. I am worried costs would explode and S3 links are just fine for downloading ZIPs. All other files could be served from CF I guess.createawesomestuff

1 Answers

0
votes

For your scenario, CloudFront serves the purpose. But I also don't understand the reason behind limiting the media files and large downloads.

However if you have a very strong concern, you can use an Edge Lambda with Generated HTTP responses to write the logic to redirect from CloudFront to a S3 or EC2 url for media files and download large files, bypassing CloudFront.