Skip to content

Support mirroring from another proxy instance (peer caching) #41

@andrew

Description

@andrew

A proxy instance should be able to use another proxy instance as a cache peer, fetching artifacts (and potentially metadata) from it before going to the real upstream registry.

The storage interface already uses deterministic paths (ecosystem/name/version/filename for artifacts, _metadata/ecosystem/name/metadata.json for metadata). Two proxy instances using the same path scheme can address each other's cached blobs directly.

A central proxy with a large cache (pre-warmed via mirror jobs) would expose a simple API:

  • GET /api/cache/{path...} - serve a blob by storage path
  • HEAD /api/cache/{path...} - check existence

Satellite proxies would configure the central instance as a peer. On cache miss, the satellite checks the peer before falling back to the public registry. Artifacts pulled from a peer get cached locally so subsequent requests are fast.

This could be implemented as a Storage wrapper that chains local storage with one or more remote peers, keeping the handler layer completely unaware of peering. The SHA256 hashes already stored with each artifact provide integrity verification on peer transfers.

Useful for multi-office setups, CI fleets, and air-gapped environments where a DMZ proxy is the only thing with internet access.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions