Hacker Newsnew | past | comments | ask | show | jobs | submit | cloudflare728's commentslogin

I have done this with Next.js. Next.js doesn't support this header or I don't know how.

I already had HAProxy setup. So I have added stale while revalidate compatible header from HAProxy. Cloudflare handle the rest.

Edit: I am not using vercel. Self hosted using docker on EC2.


Yeah, as a salty greybeard i tried to tell our FE tech-lead to just render the proper HTTP Cache-Control headers in the Next.js site we recently built. He tried and then linked me to https://nextjs.org/docs/app/guides/caching and various version of their docs on when you can and cannot set Cache-Control headers (e.g. https://nextjs.org/docs/app/api-reference/config/next-config...) and I got several hours of head-ache before calling it a problem for another day. That site is not high traffic enough to care but this is not the first time that i've gotten the "not the Next.js way" talk and was not happy.

I obviously can be done but clearly is not the intended solution which really bothers me


Well, part of the Vercel game is to lock you in to their platform and extract $$$, but as I recall you can spec out headers in NextJS config?. And possibly on CloudFlare itself via cache rules?

I am self hosting using Docker. Next.js config to change header didn't work for me. I had cache rules in Cloudflare, but Next.js header for page (no-cache) doesn't allow Cloudflare to apply stale-while-revalidate.

Now that I have proper header added by HAProxy, Cloudflare cache rules for stale-while-revalidate works.

If anyone can reach Cloudflare. Please let us forcefully use stale-while-revalidate even when upstream server tells otherwise.


Why would someone spend years developing a front where you can't tell the difference between Il or 0O? Doesn't it hurt their ego at personal level?

they probably deem it as not important. "Context is all you need to tell the difference, keep the font clean"

Context solves this ambiguity in texts recording a human language, but in computer or smartphone applications it is extremely frequent to not have a context that allows disambiguation.

Ambiguous characters may have been acceptable in typefaces designed before 1990, but they are certainly not acceptable for any more recent design, unless the typeface is designed for a very specific and limited purpose, e.g. for a single advertising poster, and they will never be used for rendering arbitrary texts.


To be fair the designer who created the font would probably agree that for use cases like passwords or serial numbers etc. you should use a different font. That's the nice thing about having different fonts around. You can choose which one you want to use.

That is a solution applicable for a document or GUI created by yourself, where you can define various styles with associated fonts and use them appropriately.

However, I see the worst offenders on various Web pages (frequently for various URLs) where I do not control the typeface, unless I instruct the browser to ignore the style sheet of the rendered Web page and use my own fonts instead, which can be tedious or create other problems in the rendered page.


I have a few CSS overrides for some websites to turn all input boxes into monospace fonts. It is far easier to use them then.

Then they can also coalesce the digit 1 into uppercase i and lowercase L because who cares right it gotta look clean. And why bother deviating from the perfect circle? The future is lowercase o, also for zeroes. Heck, why do we have the letter J anyway? Couldn't we merge that with I? It's so rarely used, it sounds iust about the same, let's iust "keep it clean"

I really can't imagine this is the thinking


It's funny I thought out a post, wrote it in my head and then scrolled a bit further and read (where you wrote it). The only difference was I choose upper-case "G" and making it a "C" instead of "J" to "I". We can also make it match open paren as well.

But yeah this whole thing seems absurd of removing the distinguishing marks on things whose only purpose is to allow us to distinguish them.

While were at it N can become \ and M as well. D can become close paren. Q can become O.

And entire font of just vertical bar, horizontal bar, open paren, close paren, forward slash, backslash and a circle. Just think of how clean it would look...


Except they're not keeping the font clean, just less legible

I hope Cloudflare improve Next.js support on Workers.

Currently pagespeed.web.dev score drops by around 20 than self hosted version. One of the best features of Next.js, Image optimization doesn't have out of the box support. You need separate image optimization service that also did not work for me for local images (images in the bundle).


Yes use zod or equivalent.

I am quite surprised people here doesn't know how to validate data in runtime. The author completely mixing Typescript with runtime behavior.

a?.b?.c?.() or var ?? something have well documented use cases and it's not what the author is thinking.


HN typically use the word "steal" when Chinese companies do the same thing from American or European companies.

It's taking them 5 years stealing Chinese algorithms.


Can someone explain to me the neon pricing?

5 minutes of inactivity makes it idle.

If I get one query every 5 minutes and each query takes 100ms for whole month, do I get changed for 720 hours or for 14 minutes (total compute time)?


update: It's 720 hours of compute cost. Not really serverless. It's just managed database service and it can scale to zero. That's it.


Seems like big no-no.

>The big reason why C corps are preferable is because S corporation shareholders can only be people -- not other businesses, like VC firms. (S corps also can't issue preferred stock.) An S corporation can't take venture capital without first reverting back to C corp status. But an S corporation can save a lot of money on taxes

https://news.ycombinator.com/item?id=13784


I wish our country was like this. A city "president" can speak against the President. A city President has the power to work without the will of the President.


Well, maybe. Under Trump I’d be less sure of that.


Can it find broken UI?

Human can find and report broken UI easily by using common sense.

Even though it is simple for human. Computer has no common sense and I am a machine learning expert. I tried and mostly failed to build a broken UI detector in my previous company. They had automated plugin upgradable process. That periodically broke UI.

I tried to detect it my taking long screenshot, and you could select a image as working version, then later finding diff between 2 images. I kind of worked but not satisfactory.


The agents can definitely detect when something is off, given they're using VLMs. They don't necessarily compare it to previous versions, rather they have opinionated takes on whether something looks broken / off. So - yes!


It is abusing .new domain. The idea of .new domain is to create something new e.g meet.new creates new Google Meet, docs.new creates new Google Docs


cto.new creates a new cto chat session from the homepage


> Navigation to a .new domain must bring a user directly into the action generation or online creation flow. Navigation or redirection to a homepage or landing page that requires the user to take additional steps or clicks to initiate action or creation will not be deemed to comply with this policy.

https://www.registry.google/policies/registration/new/

I’m not sure using it as their homepage that has a text box on it is really what they had in mind. It’s a page where you can take steps to create a chat session, it isn’t a new chat session in itself. This is like if facebook.new brought you to your main feed, since there’s a “What’s on your mind?” text box where you can create a post. Compare that with something like docs.new which will automatically create a document and open it for editing with zero steps.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: