nodejs / nodejs/build

Caching issues breaking fetching binaries

Open
#3,224 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jinja
Stars
541
Forks
185
Avg merge
22h 15m
Merged PRs (30d)
4

Description

When a new node version is released, the list of versions at https://nodejs.org/dist/index.json is updated and the binaries are uploaded at https://nodejs.org/dist/vVERSION (e.g. https://nodejs.org/dist/v19.8.1/).

However, the website sits behind a Cloudflare cache and sometimes the data seems out of sync: the API responds saying there is a version, but the binaries are not available.

This then causes tools that try to download the latest version using this information to fail, e.g. https://github.com/actions/setup-node/issues/717

I suspect there might be a few things contributing to this:

  1. We should set Cache-Control: no-cache headers on 404 pages. Otherwise, caching proxies in the middle may fallback to default values, resulting in stale cache data. I think this might be what's happening inside the GitHub Actions environment, but I'm not sure.
  2. We should ensure things are being purged correctly: having tried a few links from my own computer with no particular proxy cache inbetween me and Cloudflare, it seems like a few URLs (e.g. https://nodejs.org/dist/v19.8.1/win-x64/node.exe) had taken at least a few hours to update after the binaries should have been there.
  3. (less important, but would be nice) We should ensure the CDN is able to serve the binaries before we update the index.json. Provided the other things are taken care of, this will prevent the issue for the window where Cloudflare might have invalidated the index.json but not the binary URLs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing cache behavior for https://nodejs.org/dist/index.json and a binary URL such as /dist/v19.8.1/win-x64/node.exe, including responses for missing files. Investigate 404 Cache-Control headers, Cloudflare purge timing, and whether binaries are available before index.json is updated. Done means new versions cannot expose stale or unavailable binary URLs through the cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
cloud, devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.