Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. The AI Build-Out Is Becoming the Biggest Economic Bet in U.S. History(wsj.com)
    discuss
  2. What the Labs Kept Secret: The German Wiki and RubyGems Hacks [video](youtube.com)
    discuss
  3. Sync Alexa Lists to Apple Reminders(github.com/ow)
    1comments
  4. Cursor launches bots that watch code from pull request to production(cursor.com)
    discuss
  5. Two-dimensional billiards are Turing complete(crm.cat)
    discuss
  6. Show HN: I made Jev moderate Discord servers(frolleks.site)
    discuss
  7. PersistentWindows – persists window positions on some events for Windows(github.com/kangyu-california)
    1comments
  8. We Run Kaizen on AI(kznconsulting.com)
    discuss
  9. Show HN: SocatUI A task manager for Socat tunnels(github.com/esurharun)
    discuss
  10. Hackers start exploiting critical WordPress flaw for code execution(bleepingcomputer.com)
    discuss
  11. CodeWeavers CrossOver 26.3 Release(codeweavers.com)
    1comments
  12. Ideas on modernizing the open-source desktop(lwn.net)
    discuss
  13. If we fix the phone, we fix society(elysian.press)
    discuss
  14. OpenAI’s A.I. Tried Breaching 4 Other Targets, Without Prompting(nytimes.com)
    1comments
  15. Sharded matrices and how to multiply them(jax-ml.github.io)
    1comments
  16. OpenAI agent hacked Australian government website, PM says(bbc.com)
    1comments
  17. Large Documents in the Browser(react-pdf.org)
    discuss
  18. Locked out: Why young Europeans can't afford to buy homes(euronews.com)
    discuss
  19. Common food additives linked to high blood pressure and heart disease(sciencedaily.com)
    1comments
  20. Interpreting a volcano's 'bulges' and predicting the next explosive eruption(vt.edu)
    discuss
  21. Log-Depth Recurrent Language Modeling(arxiv.org)
    discuss
  22. Automatically detecting AI text in my browser(seangoedecke.com)
    discuss
  23. Cognitive Offloading and the Bill That Comes Due(ninchiai.substack.com)
    discuss
  24. Show HN: CrunchMyPay – 50 pay calculators, every formula and source shown(crunchmypay.com)
    discuss
  25. Show HN: Chatlo – an iOS-native AI agent, now with Jev(apps.apple.com)
    discuss
  26. S3 is not a filesystem, and LSM trees never needed one [video](youtube.com)
    1comments
  27. Memory Control Signals Emerge Before Action in Long Horizon Agents(arxiv.org)
    discuss
  28. Changes to App Tracking Transparency in the E.U(daringfireball.net)
    discuss
  29. Eliminating Middlemen in Education Consulting(rivernova.vercel.app)
    discuss
  30. OpenAI agents plotted to access government health data amid Medicare (AU) hack(abc.net.au)
    1comments

We just shipped support for the ugliest part of HTTP: Vary

98 pointsby 5h agoblog.cloudflare.com
17 comments
4h agoHN ↗

I've been wanting this from Cloudflare for years.

The classic problem here is if you do that thing where user agents that send "accept: text/html" get HTML, while user agents that don't get JSON or some other format.

This used to be impossible to deploy behind Cloudflare caching, because they ignored the Vary header on anything other than images - so you risked caching the JSON version and then serving it up to someone who was expecting HTML.

(Independent of the Cloudflare feature I ended up deciding never to use that pattern, because I prefer having URL that predictably returns HTML or JSON - I add a .json suffix to my apps to serve JSON instead.)

58m agoHN ↗

Frankly, the supposed variability of the Accept header never really sat all that well with me; in practice I much prefer working with explicitly versioned endpoints — one of the most infuriating things is having to hardcode "Accept: text/x-myorgname-custom-json-blob-v4" because omitting it would produce "406 Not Acceptable". Bonus points if that's the only Accept header the service would ever accept in all of three years of it working before being decommissioned. Double bonus points if v5 would be introduced behind a separate URI anyway (and it, too, would require precisely "Accept: text/x-myorgname-custom-json-blob-v5" and nothing else).

4h agoHN ↗

Nice to see. I’ve used vary to quite a bit of success on CloudFront back in the day.

I actually assumed when I started using Cloudflare that it did have vary support and it led to a serious bug in my sass app at the time.

4h agoHN ↗

I honestly thought they would never ship this. Holy hell this has been a long time coming.

Actual real content negotiation in 2026. Never thought I'd live to see the day.

3h agoHN ↗

"If the origin response does not include a Vary header, Cloudflare caches the response normally"[1]

"If one response omits it, Cloudflare could cache that response without the variance needed to keep it isolated."[2]

Will that non-Vary cache object front-run any Vary-segmented cache objects?

If so, probably worth adding a snippet rule to ensure every response has a Vary header?

1: https://developers.cloudflare.com/cache/concepts/vary/#how-v...

2: https://blog.cloudflare.com/vary-support/#how-a-response-mov...

2h agoHN ↗

finally. now maybe they'll have time to implement a working unsubscribe on their marketing emails.

2h agoHN ↗

Turns out their marketing can get to you through HN posts…

2h agoHN ↗

I had not actually realized what a mess Vary is.

Wow, sometimes I think it's amazing the web works at all!

2h agoHN ↗

It pains me to think about the important ones like varying on session cookie and authorization headers, and how badly some middleware can confuse things.

We generate custom content for a given authentication context. We definitely want caching at the user agent, but we want the cache keyed by the authenticated identity. Otherwise something like logging out and logging in as a different identity can produce monstrously confused results when an SPA or similar mixes some cached and some fresh responses into one page.

1h agoHN ↗

Cache invalidation, one of the two hard problems in computer science.

I'm sure most people here already knows the joke, but for the lucky 10,000, here's the full joke:

There are only two hard problems in computer science. Naming things, cache invalidation, and off-by-one errors.

1h agoHN ↗

Imagine if we actually built a remote application delivery platform instead of cobbling one onto a glorified document reader

2h agoHN ↗

If this surprises you, remember that Cloudflare doesn't cache HTML by default.

1h agoHN ↗

They can't do that because a CMS under Cloudflare needs to be configured to bust the Cloudflare cache when content is edited or the user will see cached content after they edit a page.

1h agoHN ↗

OTOH a CMS that doesn’t send correct cache headers is already broken

55m agoHN ↗

That might be the default configuration if your CMS doesn't return any cache-control headers. But Cloudflare definitely [0] supports must-revalidate and etag or last-modified, which is also probably supported by whatever CMS you're using. HTTP conditional requests are very old and very widely supported.

[0] Okay, my claim is only definite up to my memory of using Cloudflare for a fairly high-traffic circa 2019-2022. I haven't used Cloudflare after that point, but a quick search of their docs shows support

4m agoHN ↗

A site I work on serves dynamic language content based on the accept-language header. We do this for some pages and others we redirect to i.e /en/page

But we can't cache those dynamic pages since they vary based on accept language. Maybe with this we can