GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(remote-cache): add self-hosted public cache server by fengmk2 · Pull Request #718 · voidzero-dev/vite-task

Conversation

@fengmk2

@fengmk2 fengmk2 commented Sep 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Add packages/remote-cache for the server in #716, using Cloudflare Workers, primary D1 metadata, and a private R2 bucket. The server supports public reads and GitHub Actions OpenID Connect checks for writes. Stores use streaming uploads, atomic publication, storage limits, and automatic data expiry.

One workflow deploys related changes to a persistent staging Worker, D1 database, and R2 bucket. Internal PRs, main pushes, and manual runs share these resources. The workflow runs deployments and smoke tests in sequence, then updates PR comments with the tested revision and manual instructions. Each deployment replaces the previous revision. Closing a PR keeps staging available. Setup uses repository secrets and variables. Repository maintainers can configure staging without a GitHub environment.

The e2e plan defines automated checks and manual exercises. PR runs check public reads and rejected writes. Pushes to main also check authorized uploads, multipart storage, replacement, concurrency, and quotas. Local tests repeat smoke checks against reused storage and retain maximum-payload and scheduled-handler coverage. Real Cron execution and maximum payloads on Cloudflare require separate release exercises.

/fetch returns only { kind: "fallback", key } for fallback matches and does not read R2. Exact matches return the value and blob_id. A missing or unreadable exact value returns 503. Fetch misses and unavailable blobs return plain-text 404, as specified in the local RFC.

Setup rejects incompatible origins and repositories before it changes existing policies or saved configuration. Each Worker has separate rate-limit counters that remain stable across revisions. Workers Free CPU support remains unverified. The guide recommends Workers Paid for the full payload limits.

Motivation

Maintainers need a cache service in their own Cloudflare account. Developers and fork contributors must reuse public task results without login. Only trusted jobs on main should publish those results. Reviewers need one persistent staging environment and a clear verification result after each related change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@socket-security

socket-security Bot commented Sep 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​esbuild@​0.28.1911007387100
Addednpm/​tsx@​4.23.131001008194100
Addednpm/​jsonc-parser@​3.3.110010010087100
Addednpm/​wrangler@​4.131.1981009296100
Addednpm/​jose@​6.2.1210010010092100
Addednpm/​cborg@​6.1.210010010095100
Addednpm/​@​cloudflare/​workers-types@​5.20260911.11001009699100
Addednpm/​miniflare@​5.20260911.0-alpha9910010096100

View full report

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Sep 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.07%  [ -8.97% ..  +8.57%]  overhead  +264.05%
dynamic/access             change  +0.02%  [ -1.08% ..  +1.26%]  overhead   +15.12%
dynamic/access-relative    change  +0.01%  [ -0.89% ..  +1.00%]  overhead   +60.60%
dynamic/access-contended   change  -0.15%  [ -1.23% ..  +1.99%]  overhead   +13.66%
static/launch              change  +0.67%  [ -5.51% ..  +6.65%]  overhead  +729.40%
static/access              change  +0.08%  [ -0.88% ..  +1.42%]  overhead  +807.35%
static/access-relative     change  +0.21%  [ -0.79% ..  +1.44%]  overhead +1396.86%
static/access-contended    change  +0.03%  [ -0.71% ..  +0.64%]  overhead +3157.85%

macos

dynamic/launch             change  -0.34%  [ -2.98% ..  +3.05%]  overhead  +213.39%
dynamic/access             change  -0.78%  [ -3.50% ..  +2.41%]  overhead    +6.35%
dynamic/access-relative    change  +0.10%  [ -1.96% ..  +1.95%]  overhead  +262.54%
dynamic/access-contended   change  +1.26%  [ -3.03% ..  +5.95%]  overhead    +2.86%

windows

dynamic/launch             change  -0.06%  [ -8.88% .. +10.39%]  overhead   +22.04%
dynamic/access             change  +0.37%  [ -4.17% ..  +9.20%]  overhead    +1.70%
dynamic/access-relative    change  +0.18%  [ -2.63% ..  +3.81%]  overhead    +1.85%
dynamic/access-contended   change  -0.53%  [-11.13% .. +21.27%]  overhead    +1.07%
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Sep 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Remote cache staging

Commit: b30dcd5b6d1943459a16d20bcbdc1d3a28d9a627

Cloudflare staging deployment and smoke tests passed. You can now perform manual verification.

Endpoint: https://vp-cache-ci-staging.voidzero-docs.workers.dev/projects/manual

Download the remote-cache-e2e-37270179886-1 artifact from the workflow run. It contains manual-fetch.cbor, manual-manifest.json, and report.json.

PR checks cover public reads and rejected writes. Main-branch push checks also cover authorized HTTP stores. This staging endpoint is shared by all PRs and main. A later deployment replaces its code and manual fixture. Compare the deployment ID in the response with the artifact before manual verification. Closing this PR does not remove staging.

Manual checks and complete e2e plan.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2
fengmk2 force-pushed the feat/public-remote-cache branch from 194d39f to e461d47 Compare September 14, 2026 15:16
@fengmk2

fengmk2 commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Deploy prompt:

Refer to the deployment instructions at https://github.com/voidzero-dev/vite-task/blob/feat/public-remote-cache/packages/remote-cache/docs/self-hosting.md to deploy a remote cache service for the current repo.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi
wan9chi force-pushed the feat/public-remote-cache branch from df2d129 to e127e9b Compare September 27, 2026 16:04
@wan9chi
wan9chi changed the base branch from main to remote-cache-hardening September 27, 2026 16:04
@wan9chi
wan9chi added this pull request to stack #759 September 27, 2026 16:04
Base automatically changed from remote-cache-hardening to main September 27, 2026 16:32
@wan9chi
wan9chi force-pushed the feat/public-remote-cache branch from e127e9b to d4b0fea Compare September 27, 2026 16:32
@wan9chi wan9chi mentioned this pull request Sep 27, 2026
feat(cache): use HTTP 404 for remote cache fetch misses #772
Merged
@wan9chi
wan9chi force-pushed the feat/public-remote-cache branch from 58347c9 to c2f00bd Compare September 27, 2026 17:15
@wan9chi
wan9chi removed this pull request from stack #759 September 27, 2026 17:15
@wan9chi
wan9chi changed the base branch from main to remote-cache-fetch-404 September 27, 2026 17:15
@wan9chi
wan9chi added this pull request to stack #773 September 27, 2026 17:16
Base automatically changed from remote-cache-fetch-404 to main September 28, 2026 02:52
wan9chi added a commit that referenced this pull request Sep 28, 2026
@wan9chi @claude
feat(cache): use HTTP 404 for remote cache fetch misses (#772)
c7e7635
## Motivation

The public cache service (#718) follows its RFC and answers a fetch that
matches neither key with HTTP 404 and a plain-text body. It never sends
`kind: "not_found"`. The client and the Node test backend still used a
200 response with `kind: "not_found"`, so a miss meant different things
depending on the server. This switches both to 404 and drops the
`not_found` kind, giving the client and both servers one miss contract.

## Changes

- `vt_remote_cache`: `Client::fetch` returns `Result<Option<Fetched>,
Error>`, with `None` for a 404 response. `Fetched` only describes the
body of a 200 response, so its `NotFound` variant is removed. A 200
response with `kind: "not_found"` is now a malformed response. Every
other non-200 status is still an error, and a 404 download still fails.
- Test backend (`packages/tools`): a fetch miss gets a 404 with the body
`Not found`, logged as `POST /fetch 404`.
- The remote cache e2e snapshots change only in those backend lines and
responses. The `vp run` output is unchanged.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@wan9chi
wan9chi force-pushed the feat/public-remote-cache branch from c2f00bd to 0c55376 Compare September 28, 2026 02:52
@wan9chi wan9chi mentioned this pull request Sep 28, 2026
feat(cache): authenticate remote cache uploads with GitHub Actions OIDC #774
Closed
wan9chi added a commit that referenced this pull request Oct 4, 2026
@wan9chi @claude
test(cache): stall uploads with vtt stalled-remote-cache again
813023c
This reverts a463bde. The stall cases test how vp run handles a backend
that never answers, not the backend itself, and the real cache service
from #718 will replace remote-cache-server in these tests. That service
can't stall, so --stall would have to move into its proxy, and the cases
would stay skipped on Windows and musl. vtt stalled-remote-cache
--fetch-miss runs on every platform without Node.js.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wan9chi wan9chi mentioned this pull request Oct 4, 2026
test(cache): make stalled-remote-cache a proxy for the remote cache #795
Merged
wan9chi added a commit that referenced this pull request Oct 4, 2026
@wan9chi @claude
test(cache): make stalled-remote-cache a proxy for the remote cache (#…
90d256f
…795)

## Motivation

The e2e cases for a remote cache that never answers need some requests
to stall while others behave normally. For example, an upload case needs
its fetch to reach a backend and miss before the upload stalls. `vtt
stalled-remote-cache` was its own endpoint and stalled every request, so
it couldn't do that. #718 will replace `remote-cache-server` with the
real cache service, which can't stall requests itself. So the stalling
has to happen in front of whatever backend a test runs.

## Changes

- **Proxy.** `vtt stalled-remote-cache [--stall ROUTE]... COMMAND
[ARGS...]` is now a proxy for the endpoint in `VP_REMOTE_CACHE_URL`,
which must be `http://<host>:<port>/<path>`. It runs the command with
`VP_REMOTE_CACHE_URL` set to the proxy.
- A request to a stalled route below the endpoint, such as `/store`, is
never answered, and it emits a `stalled` milestone.
- Other requests are forwarded with `connection: close`, so each one
comes in on its own connection and is checked on its own.
  - A forwarded request gets a 502 if the endpoint can't be reached.
- **Fetch cases.** `ctrl_c_during_fetch` and `fast_fail_during_fetch`
stall `/fetch`, with an unreachable endpoint behind the proxy. They
still run on every platform without Node.js.
- **New `ctrl_c_during_upload` case.** It runs `remote-cache-server vtt
stalled-remote-cache --stall /store vt run build`. The fetch reaches the
backend and misses, the upload stalls, and Ctrl-C cancels it.
- **`remote-cache-server`** now ignores Ctrl-C and leaves it to its
command, so it still prints its request log afterwards.

## Notes for reviewers

- **Lost milestones on Windows.** A milestone there is the console
title, and ConPTY sends it on its next render. If the command sets a
milestone at about the same time as the proxy, the earlier one can be
lost. The doc comment says so. Cases that need `remote-cache-server` are
skipped on Windows anyway.
- **Conflict with #718.** #718 rewrites
`packages/tools/src/remote-cache/cli.ts`, so the line that ignores
Ctrl-C needs to move into its version.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 4, 2026
refactor(cache): let remote cache requests carry auth headers #797
Merged
feat(cache): authenticate remote cache uploads with GitHub Actions OIDC #798
Merged
@wan9chi
wan9chi force-pushed the feat/public-remote-cache branch from 0c55376 to c4d5b0b Compare October 5, 2026 01:39
@wan9chi
wan9chi removed this pull request from stack #773 October 5, 2026 01:40
@wan9chi
wan9chi changed the base branch from main to claude/github-oidc-auth-headers-18e511 October 5, 2026 01:40
@wan9chi
wan9chi added this pull request to stack #799 October 5, 2026 01:40
@wan9chi
wan9chi force-pushed the claude/github-oidc-auth-headers-18e511 branch from c724b54 to 238a29c Compare October 5, 2026 02:09
Base automatically changed from claude/github-oidc-auth-headers-18e511 to main October 5, 2026 02:14
@wan9chi
wan9chi force-pushed the feat/public-remote-cache branch from c4d5b0b to 172ad91 Compare October 5, 2026 02:23
fengmk2 and others added 16 commits October 5, 2026 12:45
@fengmk2 @codex @wan9chi
feat(remote-cache): add self-hosted public cache server
525eb62
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
docs: link remote cache changelog to pull request
0d935d9
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
ci(remote-cache): deploy previews and verify Cloudflare
3483916
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
fix(remote-cache): initialize CI types and revise cleanup trigger
1fd4532
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
test(remote-cache): synchronize upload cancellation with stream reads
456d756
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
docs(remote-cache): include RFC and supporting material
49d4715
Copy RFC #716 from c201f8e and adjust relative paths.

Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
docs(remote-cache): use the local RFC status contract
e66ac95
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
fix(remote-cache): align RFC responses and isolate deployments
2bdfb0d
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
ci(remote-cache): use one persistent staging deployment
f2ce6c1
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
ci(remote-cache): use repository secrets for staging
8c242c4
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
fix(remote-cache): preserve trigger bodies in D1 migrations
f53d5f2
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
refactor(remote-cache): simplify service and deployment code
d477b5c
Remove the obsolete cache size study and its RFC link.

Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
chore(remote-cache): document self-hosting and default staging to free
bab1029
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
feat(remote-cache): add Deploy to Cloudflare button
8a4a6d0
Co-authored-by: GPT-6 Codex <[email protected]>
@fengmk2 @codex @wan9chi
ci(remote-cache): guard temporary deployment button URLs
360af3d
Co-authored-by: GPT-6 Codex <[email protected]>
@wan9chi @claude
ci(remote-cache): run the standalone check with a native pnpm executable
b30dcd5
`npm_execpath` points to pnpm's standalone executable on the Linux and
Windows runners, so running it through `node` failed. Run it directly
unless it's a JavaScript entry point.

The remote cache package also brought esbuild and workerd into the
workspace, and a root `pnpm install` without `--ignore-scripts` failed
on their unapproved build scripts. Allow them, as the standalone package
already does.

Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 5, 2026
test(cache): give each remote cache e2e case a long-lived backend #807
Merged
test(cache): number remote cache blobs and corrupt them through the backend #808
Merged
test(cache): authenticate remote cache e2e uploads with a GitHub Actions stand-in #809
Merged
@wan9chi
wan9chi force-pushed the feat/public-remote-cache branch from 172ad91 to b30dcd5 Compare October 5, 2026 05:58
@wan9chi wan9chi mentioned this pull request Oct 5, 2026
test(cache): run the remote cache e2e tests against the Cloudflare Worker #811
Merged
@wan9chi
wan9chi removed this pull request from stack #799 October 5, 2026 05:59
@wan9chi
wan9chi changed the base branch from main to remote-cache-e2e-rejected-uploads October 5, 2026 05:59
@wan9chi
wan9chi added this pull request to stack #812 October 5, 2026 05:59
@wan9chi
wan9chi removed this pull request from stack #812 October 6, 2026 02:42
@wan9chi

wan9chi commented Oct 6, 2026

Copy link
Copy Markdown
Member

Moved to voidzero-dev/vite-plus-remote-cache-cloudflare, with its history and authors preserved.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi wan9chi closed this Oct 6, 2026
@wan9chi wan9chi mentioned this pull request Nov 4, 2026
☂️ Release remote caching #930
Open
wan9chi added a commit that referenced this pull request Nov 7, 2026
@wan9chi @claude
test(cache): run the remote cache e2e tests against the Cloudflare Wo…
e28b789
…rker (#811)

## Motivation

The remote cache e2e cases ran against a Node file backend that imitated
a remote cache server's protocol and write policy. #807 → #810 put the
test infrastructure in place against that backend: one backend per case,
a tap for the request log, blob numbering, `corrupt-blob`, and a GitHub
Actions stand-in. Vite+'s Cloudflare implementation now lives in
[voidzero-dev/vite-plus-remote-cache-cloudflare](https://github.com/voidzero-dev/vite-plus-remote-cache-cloudflare),
moved there from #718, and the cases can run against it: a real,
independently written server for the protocol.

## Changes

- **Backend.** Behind the same `remote-cache-server` commands, the
backend is that Worker at a pinned commit, a git dependency of
`vite-task-tools`, running in workerd through Miniflare:
- The Worker runs with the compatibility settings, bindings, and limits
that wrangler reads from its `wrangler.jsonc`. Its namespaces are
limited to the endpoint's.
- As in a deployment, every migration is applied with wrangler's SQL
splitter, and the namespace is registered for the endpoint and the test
repository.
- The Worker fetches GitHub's key set to verify upload tokens and gets
the stand-in's key instead. Any other outbound request fails.
- `corrupt-blob` replaces the blob's object in R2 and its recorded size.
- **Workspace.** The workspace allows esbuild's and workerd's build
scripts, which a root `pnpm install` otherwise rejects.
`@cloudflare/workers-types` provides Miniflare's binding types.
- **Removed** the file backend and its `@fastify/busboy` dependency.
- **musl.** The cases that use the backend are skipped on musl, because
workerd's prebuilt binaries require glibc.
- **Restarts.** `start` empties the Worker's D1 database and R2 bucket
in `remote-cache/state/` first, since the migrations assume a new
database.
- **Tap.** The Worker rejects an upload by its headers, answering before
it reads the body, and then closes the connection. The tap no longer
counts the failure to send the rest of that body as a backend problem
once the whole response has arrived. With a large rejected upload,
`stop` failed every time before this change.

**None of the snapshots change.** Apart from that tap fix, the daemon,
the tap, the CLI, and the stand-in are untouched. Only the backend
behind them is different.

Stacked on #810.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Test-infra swap with heavier Node deps and platform limits (no musl);
behavior now depends on an external Worker package and Miniflare, though
production client code is unchanged.
> 
> **Overview**
> Replaces the in-repo **Node file backend** (`state.json` + blob files)
with **Vite+'s pinned Cloudflare remote cache Worker**, started locally
via **Miniflare/workerd**. `startBackend` bundles the Worker with
esbuild, applies D1 migrations, registers the test namespace, mocks
GitHub JWKS for upload tokens, and persists state under
`remote-cache/state/` (cleared on each `start`). **`corrupt-blob`** now
writes corrupt bytes into **R2** and updates the recorded blob size.
> 
> **Dependencies:** adds `miniflare`, `wrangler`, `esbuild`, and the
git-pinned Worker package; removes `@fastify/busboy`. Workspace
**`allowBuilds`** enables **workerd** install scripts.
> 
> **E2E:** every snapshot case that starts `remote-cache-server` gets
`cfg = 'not(target_env = "musl")'` because workerd needs glibc. README
documents the new backend.
> 
> **Tap fix:** when the Worker rejects an upload from headers and closes
the connection before the body is sent, the proxy no longer treats the
resulting write error as a backend failure once the response is
complete—so `stop` stays reliable on large rejected uploads.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
7ddfbd5. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@fengmk2 @wan9chi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.