Skip to content

[pull] main from jsr-io:main#103

Merged
pull[bot] merged 3 commits into
code:mainfrom
jsr-io:main
Jun 15, 2026
Merged

[pull] main from jsr-io:main#103
pull[bot] merged 3 commits into
code:mainfrom
jsr-io:main

Conversation

@pull

@pull pull Bot commented Jun 15, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

## What

Drops `stale-while-revalidate=86400` from `CACHE_CONTROL_MANIFEST` (the
cache-control for package and npm version `meta.json` manifests):

```
- public, max-age=60, s-maxage=60, stale-while-revalidate=86400
+ public, max-age=60, s-maxage=60
```

## Why

After a publish, a new version only becomes visible to Deno's resolver
once the edge re-fetches the regenerated `meta.json`. We explicitly
purge Cloudflare on publish, but that purge is best-effort, so the
cache-control is the durability net.

The SWR window was that net's weak point: it let an edge keep serving a
**stale** manifest for up to 24h. And critically, SWR bought us nothing
here — the lb serves a cached entry on a hit *without re-fetching* (see
`proxyToR2`), so the background "revalidation" SWR implies never
actually happens; it only extends the stale window.

Without SWR, a request past `s-maxage` is an unambiguous miss that
forces an R2 re-fetch. This caps worst-case post-publish resolver
staleness at **`s-maxage` (~60s)** instead of **up to 24h**.

## Trade-off to review

This slightly increases manifest re-fetches from R2 (the edge can no
longer lean on a stale copy past `s-maxage`), but `s-maxage=60` still
bounds that to roughly one R2 fetch per package per minute per PoP.
Worth a sanity check.

## Not in scope

Eliminating the remaining ~60s floor (`s-maxage`) requires a purge-key
redesign — the manifest is keyed under the synthetic
`bucket-cache.jsr.internal` host (#1440), which isn't zone-purgeable by
URL — and is intentionally left out of this change.
@pull pull Bot locked and limited conversation to collaborators Jun 15, 2026
@pull pull Bot added the ⤵️ pull label Jun 15, 2026
@pull pull Bot merged commit 466118f into code:main Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant