Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Linux support is coming to Snapdragon X2 Series(qualcomm.com)
    75comments
  2. Claude discovers a novel enzyme system with CRISPR-like repeats(anthropic.com)
    544comments
  3. Meta VR Glasses(meta.com)
    215comments
  4. Feds Target AI Critics as "Foreign Agents"(kenklippenstein.com)
    12comments
  5. VSCode's SSH Agent Is Bananas (2025)(fly.io)
    90comments
  6. ArXiv receives multiyear commitments to support it as an independent nonprofit(arxiv.org)
    11comments
  7. Virtio-nvgpu: Near-native Nvidia GPU access inside a KVM guest(github.com/nestrilabs)
    5comments
  8. The "Windows XP Box" (2003)(mini-itx.com)
    10comments
  9. Mercury 2.5 LLM hits 770 tokens per second(artificialanalysis.ai)
    26comments
  10. Fixing the Portobello Police Station Clock(pointinthecloud.com)
    89comments
  11. We just shipped support for the ugliest part of HTTP: Vary(cloudflare.com)
    15comments
  12. FLAWED's Flaws and What This Means for Industry Research(suhacker.ai)
    1comments
  13. Italian parliament votes for return to nuclear energy(apnews.com)
    391comments
  14. LensVLM: Compressing long context as images, expanding only relevant pages(huggingface.co)
    7comments
  15. The mystery animal on an ancient god's head(signoregalilei.com)
    18comments
  16. Show HN: An open-source manufacturing ERP/MES/QMS(carbon.ms)
    6comments
  17. Making Tailscale Faster(tailscale.com)
    39comments
  18. A brief history of Windows scroll bar shortcuts(devblogs.microsoft.com/oldnewthing)
    51comments
  19. Show HN: Combinators in Array Languages(softwarewrighter.com)
    discuss
  20. Australia says OpenAI agent hacked into government website(channelnewsasia.com)
    7comments
  21. Gemini 3.8 text-to-speech(blog.google)
    124comments
  22. Tokens too cheap to meter(jyn.dev)
    180comments
  23. The Curious Power of Punctuation(newyorker.com)
    5comments
  24. Augustofaces: Pareidolia Fine Art(augusto.at)
    1comments
  25. Radicle: Disclosure of Vulnerability in the Network Protocol(radicle.dev)
    50comments
  26. Swap, ZRAM, Zswap and Hibernate on NixOS(matthewbrunelle.com)
    10comments
  27. I don't want the details(michaelheap.com)
    200comments
  28. Z80 REPL (2018)(abagames.github.io)
    18comments
  29. QuestDB (YC S20) Is Hiring a Sales Engineer(questdb.com)
    discuss
  30. A refined phylochronology of the second plague pandemic in Western Eurasia(pnas.org)
    discuss

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

87 pointsby 4h agoblog.cloudflare.com
15 comments
3h 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.)

12m 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).

3h 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.

3h 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.

2h 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…

1h agoHN ↗

I had not actually realized what a mess Vary is.

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

1h 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.

49m 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.

41m agoHN ↗

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

1h agoHN ↗

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

52m 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.

51m agoHN ↗

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

10m 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