Live data from Hacker News

Cloudflare Pages: Best server tech since CGI-bin?

taras.glek.net

21–30 of 226 posts

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

#21

I am waiting for the time where we can host WordPress freely with static hosting and workers for admin ui/dynamic content. Otherwise static websites are only for devs.

This. I keep seeing these 'JAMstack' sites are the new hot thing when a static wordpress site is enough and easier to update than 'JAMstack' sites, in reality these sites are just glorified HTML under a CDN. I don't see the benefit of JAMstack when you can just place a static WP site under a CDN like Cloudflare and have all the benefits of WP and a CMS to edit content. At least with Cloudflare they are more than just…

They solve different problems. WordPress is a full stack solution that's great for blogs and simple websites. The downside is that it's a lot of maintenance (requiring a LEMP stack) and not very portable. You have to copy over everything from the code to the database to the files to things like htaccess and nginx config. Hosts Like Pantheon and wpengine make that easier, but you're still bogged down by overhead. Scaling is really hard if mere caching doesn't work because you have to deal with Mysql replication and slaving. And what's really annoying about this setup is that you HAVE to deal with the whole stack. If the content writers want to preview their changes, you have to a clone them a staging environment. That means DB merges or overrides. And if you're simultaneously making other changes to the production DB, good luck reconciling the two.

Jamstacks really shine when you can decouple the frontend from the backend(s), because then you have an easily replicable single repo with nothing but code. You can deploy it to any Jamstack host with a push and they handle all of the scaling and https and caching concerns. And the backend teams, whether an in house endpoint or content writers working on a hosted headless CMS, never have to care about the stack.

A middle ground that's interesting to explore is using WordPress with Advanced Custom Forms as a backend plus a Jamstack frontend. ACF is still quite a bit more powerful than any of the headless CMS solutions I've tried, but it does mean you still have to maintain a LEMP stack, which is a headache in and of itself.

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

#23

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.

You can pretty easily change from Cloudflare to any other Jamstack host. Cgi just isn't necessary anymore and would be more baggage than anything at this point. The old web stacks are just time sinks. It's so much nicer to be able to git push... And that's it. Done.

Forgive my digression but for years I’ve seen small efforts here and there to elevate the concept of a “stack” and promote it as the level abstraction to use when discussing web apps and the like. What’s up with that?

Grab any 3 commonly used pieces of technology whose names can be used to form a fun initialism, append stack to the end, and soon there will be experts speaking at conferences dedicated to it. JamStack is an example you mentioned. I’ve heard others over the years.

I disagree that it’s a useful unit of thought. No one I know or work with ever talks about “web stacks” this way. Am I missing something here? Is this just some kind of niche? Who’s marketing these?

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

#24

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.

It’s different that than vendor lock-in.

For example you have security. CGI with multitenants is hard if not impossible. At least for the tenants that will want to use this.

Then there is scaling, resource consumption, and predictability (for planning).

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

#25

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.

The engine is open source: https://github.com/cloudflare/workerd

We did not create our own engine to create "lock-in". On the contrary, it would be a huge win for us if we could simply run FastCGI or Node or whatever applications unmodified. We'd be able to onboard a lot more customers more quickly that way! Our product is our physical network (with hundreds of locations around the world), not our specific development environment.

But none of that tech scales well enough that we could run every app in every one of our locations at an affordable price. Meeting that goal required new tech. The best we could do is base it on open standard APIs (browser APIs, mostly), so a lot of code designed for browsers ports over nicely.

(I'm the lead engineer for Workers. These were my design choices, originally.)

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

#26
post #4

I feel like there's a large class of tools in this space now (Vercel, Netlify) that do all of this and more, and this post is less about Cloudflare Pages and more about the (really good) state of static hosting these days? One thing that stuck out was the comment about "Twitter cards", since Vercel/Next now has this built in: https://twitter.com/vercel/status/1579561293069316096

Static hosting combined with server-side dynamic content modification using postgres was the interesting part for me. Static hosting has historically been seen as exactly that, static and immutable. Things like Cloudflare functions/workers can turn static hosting into dynamic content delivery while maintaining (most of) the benefits of static hosting. Granted, this can be done whether the underlying content is hosted…

Yes, it's great because static/static+some dynamic bits fits a lot of use cases and it's quite simple to deploy, manage and maintain.

It's nothing that new though, Firebase (part of GCP) and Netlify have had that for years. CloudFlare just have the right combination of marketing, reputation, pricing and tech to make headlines with it again.

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

#27

What is really annoying is that Cloudflare pages will strip the file extension off of your html pages, and perform permanent redirects to those new URLs. Now if you're intending on moving to a new hosting service that doesn't do that (cgi-bin), all Google search results to your site will 404. Github pages and likely others also supports this format, so moving between those two services doesn't exhibit this problem. M…

Having .html file extensions is very old school, and its removal is one of the popular/default redirects on all http servers that support it. Site generators also hide it through various methods (e.g. having a folder with the path name with just an index.html where a dynamic redirect isn't possible).

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

#28
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.

We just don't want to support MiTMFlare with our traffic and money.

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

#30

I am waiting for the time where we can host WordPress freely with static hosting and workers for admin ui/dynamic content. Otherwise static websites are only for devs.

I've successfully run WordPress with the simply-static plugin, and a script to send to static hosting. WP run on an arm64 instance that was only started when editing was needed.

Besides WP, there are static CMSes that fit a modern workflow perfectly.

Post reply on HN