Yeah, looks like CF should not consider itself the origin, at least if the request wasn't cached.
But I'm thinking the edge cache is dumb. Some of their docs mention that requests that aren't cached are actually just revalidated and cached at the edge (probably TTL=0) and then served by the dumb edge cache... and they didn't consider they shouldn't be entitled to be the origin in that case.
In my country we had mandated unions for tech workers in various states. I paid the compulsory annual fee plus an additional fee that I didn't understand and can't properly explain what it was for.
Not once in 23 years in IT have they done anything for me. Not a single time. Every time we pushed for raises and someone contacted the union, nothing came back. When the company was not updating our salaries against inflation (that's a thing here), the union made a deal in our behalf so the increase would be bellow inflation. Multiple times.
I'd like to see unions working but they are a joke.
EDIT: Just remembered that we constantly had issues with overtime and they didn't care either.
These days I can't be bothered to deviate from the happy path anymore as I've already spent too much time in my life customizing my desktops.
I just use whatever GNOME offers and maybe 1-2 extensions. A few months ago I switched from Fedora to Debian 12 and barely noticed it. Thanks to GNOME and systemd, which I hate independently for various reasons.
Will your solution work with any CDN at all? It seems the issue is not specific to Cloudflare.
`Date` is a registered field [0] used by origin server as defined in RFC 9110 [1]. Any CDN server will add its own date to that header since it's acting as the origin server for that request.
For Cloudflare in particular, you could try setting Cache-Control to Private=Date and see if the edge cache skips the override [2].
What you want seems to be a tunnel with WAF. In that case, a Cloudflare Worker might be a workaround to the native caching layer but I'm not sure if that has any effect on the edge device updating the Date header or not. Workers do support WAF.
Steps 1,2,3 create separate solutions that people can use as they see fit. You make it seem like there is no place for anything but a declarative programming language in this area.
But I'm thinking the edge cache is dumb. Some of their docs mention that requests that aren't cached are actually just revalidated and cached at the edge (probably TTL=0) and then served by the dumb edge cache... and they didn't consider they shouldn't be entitled to be the origin in that case.