Live data from Hacker News

Cloudflare Pages: Best server tech since CGI-bin?

taras.glek.net

121–130 of 226 posts

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

#121
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…

This sounds similar to the old Server Side Includes [1] .

In the 90s I was using SSI to build dynamic, but static sites

-- header --

-- hierarchal javscript menuing --

-- content --

-- footer --

-- tail --

[1] https://en.wikipedia.org/wiki/Server_Side_Includes

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

#122

Earlier quoted context omitted.

Hope the author responds, because that stuck out to me too! My assumption was that their prompt was something like "typescript cloudflare function" and they just used the resultant code to see types in action inside their IDE.

Author here. I just got access to OpenAI codex. I used edit function and asked it to modify the JS hello world, to add typescript annotations. This is the git commit following that gpt conversation :) -export async function onRequest(context) { +export async function onRequest(context: { + request: Request; + env: { [key: string]: string }; + params: { [key: string]: string }; + waitUntil: (promise: Promise ) => void…

lol, I was 50% sure that you were being sarcastic about using GPT-3, hehe

But if anyone is edgy enough to use AI as a shortcut, I guess it would be the guy who did telemetry ingestion on a t2.micro :D

Regards Jonas,

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

#123
post #120

Earlier quoted context omitted.

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 a…

Such hints can be unreliable at best and misleading at worst. There is nothing to guarantee that the file extension and the Content-Type header will agree, nor is there anything to guarantee that the file name in the URL will match the download file name in the Content-Disposition header.

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

#124

Earlier quoted context omitted.

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. Scal…

As much as I dislike it personally, WordPress’s admin portal and plugins like ACF (among others) are simply unbeatable when the end result is handing the keys over a client, both due to power and familiarity.

I wonder if that will change given enough time. I certainly hope so, but I would’ve guessed that it would’ve changed already, but here we are in 2022…

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

#125
post #120

Earlier quoted context omitted.

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 a…

Such hints can be unreliable at best and misleading at worst. There is nothing to guarantee that the file extension and the Content-Type header will agree, nor is there anything to guarantee that the file name in the URL will match the download file name in the Content-Disposition header.

Well, sure, but you can just... not do that? The tag can be misleading because there's no guarantee that the title matches the content of the page - but the answer to that is to use good titles for your pages, not to avoid using the tag.

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

#126
post #102

I tend to agree. Cloudflare services are awesome. Their documentation tends to be OK but thin. Certainly not great.

We're working on the documentation, I agree it can certainly be thin (or just not understandable). Please do file an issue for any improvements you'd like to see: https://github.com/cloudflare/cloudflare-docs/issues

I like documentation with lots of complete examples of every option.

Reference guides with every object/function/method documented.

Links to sample code on github.

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

#127

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`.

It's tempting to use the Oracle free instance but I wouldn't use it for production cause I don't trust it will be free in the long term.

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

#128
post #125

Earlier quoted context omitted.

Such hints can be unreliable at best and misleading at worst. There is nothing to guarantee that the file extension and the Content-Type header will agree, nor is there anything to guarantee that the file name in the URL will match the download file name in the Content-Disposition header.

Well, sure, but you can just... not do that? The tag can be misleading because there's no guarantee that the title matches the content of the page - but the answer to that is to use good titles for your pages, not to avoid using the tag.

My point is that it isn’t really reassuring for the user because of invisible negotiations. If anything, I would lean more towards guessing that users are, more often than not, either ignorant or untrusting of URL contents, either because the URLs so frequently look like nonsense (arbitrary content IDs instead of meaningful names) or because they have already proven to be unreliable elsewhere on the web (deep links not as deep as expected when copied or shared).

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

#130
post #125

Earlier quoted context omitted.

Well, sure, but you can just... not do that? The tag can be misleading because there's no guarantee that the title matches the content of the page - but the answer to that is to use good titles for your pages, not to avoid using the tag.

My point is that it isn’t really reassuring for the user because of invisible negotiations. If anything, I would lean more towards guessing that users are, more often than not, either ignorant or untrusting of URL contents, either because the URLs so frequently look like nonsense (arbitrary content IDs instead of meaningful names) or because they have already proven to be unreliable elsewhere on the web (deep links n…

> If anything, I would lean more towards guessing that users are, more often than not, either ignorant or untrusting of URL contents, either because the URLs so frequently look like nonsense (arbitrary content IDs instead of meaningful names) or because they have already proven to be unreliable elsewhere on the web (deep links not as deep as expected when copied or shared).

I think users are (rightfully) distrustful of URLs in the general case, but a URL having a file extension is actually a pretty good indication that it's a simple "does what it says on the tin". (Imgur changing their .jpg URLs to have more complex behaviour caused a pretty big backlash, for example)

Post reply on HN