Live data from Hacker News

Cloudflare Pages: Best server tech since CGI-bin?

taras.glek.net

111–120 of 226 posts

Re: Cloudflare Pages: Best server tech since CGI-bin?

#112

Why not just make it CGI (or FastCGI) compatible so you can test it locally or run it in other environments? At least for things that are actually generating responses rather than acting as middleware. Oh, right, vendor lock-in.

For better or worse fast CGI never took off much beyond PHP. Python, node, ruby, etc. all do their own thing with their own app servers and protocols. I mean sure something like python can use fast CGI but no one in that community uses it that way, everyone uses uWSGI, gunicorn, etc.

Plain old CGI doesn't scale beyond toy usage--it spawns a process per request.

So there really isn't a good single option for Cloudflare to use.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#113
post #98

Earlier quoted context omitted.

Are there guides for application architecture with Workers? I'm interested in Durable Objects but I don't know how to work within the 50-subrequest limit on the Free or Bundled plans. It sounds like I can only read from 50 Durable Objects or KV queries in a single request. If my usage pattern is e.g., sharing docs with many users, how would I let more than 50 users access a doc? Whether I consider fanning out on writ…

Hmm, I think there are several different reasons why the subrequest limit actually doesn't apply to your scenario. First, Durable Objects and Workers KV requests do not count against the 50-subrequest limit. It's HTTP requests to external servers that count. Second, with the Unbound billing model, the limit is now 1000. The old "Bundled" billing model is really intended for "configure your CDN" use cases where you're…

> First, Durable Objects and Workers KV requests do not count against the 50-subrequest limit. It's HTTP requests to external servers that count.

Ahhh, somehow I got the idea that requests from a Worker to Durable Objects and KV counted against subrequests. This changes things!

> If you mean you have 50+ users connected via WebSockets and you need to send a message to each one

I was thinking of, a client requests "give me a list of my documents" or "share this document with Alice, Bob, et al.", and the Worker that receives that request has to handle that somehow. I thought that was tough to do in 50 subrequests, but it's easy if I can just make an unbounded number requests to different Durable Objects or KV records.

Edit: I found what gave me the idea about subrequests. From the Workers docs:

> For subrequests to internal services like Workers KV and Durable Objects, the subrequest limit is 1000 per request, regardless of usage model.

https://developers.cloudflare.com/workers/platform/limits/#h...

Re: Cloudflare Pages: Best server tech since CGI-bin?

#114
post #9

The rest of the industry haven't even started figuring out what Cloudflare Pages Functions + Durable Objects can do. Workers can also send emails for free, and soon you will be able to process them as well with Email Workers. Cloudflare also doesn't charge you for egress either.

I mostly agree.

> Workers can also send emails for free, and soon you will be able to process them as well with Email Workers.

There's got to be some limitations to that and I don't like it when they're not well defined. Looking at the MailChannels pricing, it looks like it's roughly 40x more expensive than AWS SES on the low end and 4x on the biggest plan before negotiating a custom deal.

I can send 500k emails and have a dedicated IP on SES for the same cost as 40k emails from MailChannels. Since their big value add seems to be scanning emails to prevent spam from user generated content, I just don't see it if that's not functionality you need because it's all wasted resources / unnecessary cost in those cases.

I assume there's a point where it's no longer free and I'm guessing the cost once you get there will be high.

Plus, am I sharing IPs with people who are sending such low-quality mail it requires outbound spam filtering? That seems like a huge negative on the deliverability side of things.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#116

Earlier quoted context omitted.

You go ahead and play "being decentralised" with your buddies while people in the real world just mind their own business doing whatever they need to do using the current right tool for the job(in this case Cloudflare being the tool).

In nature, a lack of genetic diversity in a species isn't typically much of a problem until there's an extinction event, and then it can be a big problem. You might not feel the downsides of having a huge percentage of the internet going through a single provider until it's too late to change it. I actually quite like Cloudflare, and I don't think they're purposely doing anything nefarious (just following incentives…

At least it is not Microsoft, Google or Meta providing the monopoly! For now…

Re: Cloudflare Pages: Best server tech since CGI-bin?

#118

Cloudflare Pages and Workers (and similar products) are indeed great but I recently switched over to a plain old free tier Oracle Cloud VM with FastAPI behind Nginx (Docker containers). I use Cloudflare as a proxy for HTTPS/certs. I don't have to think about Cloudflare Worker limitations, can host a Postgres instance, and simply deploy through `git pull` and `docker-compose up`.

But now Oracle has your financial information. I would rather give my Social Security number to a Nigerian prince.

There's a reason Larry Ellison owns an entire Hawaiian island, and it ain't nothin' nice...it ain't nothin' nice (#QTip)

Re: Cloudflare Pages: Best server tech since CGI-bin?

#119

Potentially stupid question: how is this different from hosting a static site on S3 and using CloudFront as a CDN? Assuming I don't need server-side JS, I don't see the benefit.

IMHO, when I use AWS I feel like I spend a lot of time dealing with the infrastructure. For example, you have to create the bucket, add IAM users that can deploy to it, set up CI that can do that deploy, configure CloudFront, etc..

With CloudFlare Pages you click a couple buttons in the UI and push to GitHub. When I tested it, I didn't get bogged down managing infrastructure which I've always struggled with (overthinking) in the past. I was almost instantly writing code that solves my problem(s).

The advantages aren't as huge with a purely static site, but they're still there IMO.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#120

Earlier quoted context omitted.

Yes. New school's defining feature is needless layering of complexity to hide the simple truth of the file system from users.

Is there a reason why someone visiting your website should know or care about file extensions?

The user presumably wants to know what kind of content they're going to receive from a given endpoint - foo.html, foo.pdf, foo.jpg, foo.mp3 and foo.avi suggest quite different experiences, and it's nice to include that hint in the URL (where it's visible on mouseover) rather than the user having to go in blind. I also like being able to reassure the user that they're receiving the same piece of content however they access a given resource, rather than the possibility of invisible content negotiation changing the site's behaviour.
Post reply on HN