News for hackers. Stuff that matters.
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by NovemberWhiskey on Friday October 16, 2020 @11:42AM (#24801903)
Article reads more like "I became a user of Cloudflare's CDN" than "I setup my own personal CDN"; perhaps I'm missing the point though?!
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by cameronfraser on Friday October 16, 2020 @12:16PM (#24802250)
I think the default image for the youtube video in the article speaks to who the target demographic is.... it's definitely not HN, but w/e
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by simonw on Friday October 16, 2020 @12:37PM (#24802466)
If you want to survive a spike of traffic from something like HN a simple way to do it is to run your site behind something like Cloudflare and set each page to cache for a short period of time.

Cloudflare implements a dog pile prevention mechanism where if ten simultaneous requests come in for the same page they will make only a single request to the backend, so even just a few seconds of cache time can absorb a huge amount of traffic.

Since my blog rarely updates I use a 15 minute cache time and manually purge the Cloudflare cache when I modify a blog entry. I've survived quite a few high traffic incidents that way.

Re:I Setup My Own Personal CDN Using Cloudflare and S3 by jayzalowitz on Friday October 16, 2020 @11:44AM (#24801910)
You should really be using an OAI to let cloudfront get your content, serve out of there with a local cache policy..

https://docs.aws.amazon.com/AmazonCloudFront/latest/Develope...

Open bucket is an antipattern here.

Re:I Setup My Own Personal CDN Using Cloudflare and S3 by underbluewaters on Friday October 16, 2020 @12:26PM (#24802353)
I'm just going to go ahead and threadjack here with a CDN question since the article isn't all that informative.

What's the best way to utilize a service like Cloudfront or Cloudflare when you need low latency access to static files that aren't getting a lot of traffic? I'd pay more for a service that lets me serve 12kb-10MB files with <50ms latency on Cloudflare edge nodes but some of them are only going to be accessed once a day or less. My understanding is that most of the time these files would just fall out of the edge cache. There'd still be the advantage of going through Cloudflare/Cloudfront's private network but I'm still going to be limited by S3's latency.

Re:I Setup My Own Personal CDN Using Cloudflare and S3 by TYPE_FASTER on Friday October 16, 2020 @01:40PM (#24803106)
Cloudflare will respect the "Expires" HTTP header: https://support.cloudflare.com/hc/en-us/articles/200172516-U...

It looks like the edge cache max TTL is a month: https://community.cloudflare.com/t/how-long-cloudflare-keeps...

Re:I Setup My Own Personal CDN Using Cloudflare and S3 by Hitton on Friday October 16, 2020 @12:40PM (#24802491)
I don't know about Cloudfront, but for Cloudflare check out Cloudflare Workers Sites.
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by mazamats on Saturday October 17, 2020 @11:38AM (#24810767)
You don’t even need the S3 Bucket... Cloudflare will work as a transparent proxy and will cache all static assets.
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by velebak on Friday October 16, 2020 @02:28PM (#24803586)
If you're using S3, what's wrong with Cloudfront?
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by mike503 on Sunday October 18, 2020 @04:25AM (#24816314)
charges for traffic from edge -> user. At least with Cloudflare, you'd only be charged the (roughly one) trip from origin (s3) -> edge. Then it's free.
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by whalesalad on Friday October 16, 2020 @11:59AM (#24802082)
tl;dr for anyone ever needing to use S3 as a website:

- S3 bucket w/ same name as domain.

- CNAME to bucket

- OR enable static website hosting, CNAME to your bucket's website dns name provided by AWS.

- Done, just make sure CF is proxying not doing pass-thru.

- PS, permissions need to allow public read of your data, of course.

Re:I Setup My Own Personal CDN Using Cloudflare and S3 by NovemberWhiskey on Friday October 16, 2020 @12:09PM (#24802188)
Or if you're already in the AWS ecosystem, maybe don't even bother with Cloudflare and just use AWS CloudFront?
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by whalesalad on Friday October 16, 2020 @12:10PM (#24802197)
I can't think of a good reason to not use Cloudflare. They are incredible.

(That being said, there is nothing wrong with Cloudfront. On a recent project we are using all three, cloudfront and cloudflare are not mutually exclusive)

Re:I Setup My Own Personal CDN Using Cloudflare and S3 by mazamats on Saturday October 17, 2020 @11:38AM (#24810758)
Cloudflare acts as a transparent proxy, cloud front lets you cache only s3 buckets...
Re:I Setup My Own Personal CDN Using Cloudflare and S3 by mike503 on Sunday October 18, 2020 @04:25AM (#24816316)
cost