main
1// Learned server properties, ply's `Quirks`, per origin, for the isolate's life. A fact about a server, learned from
2// its own answer, the same for every caller, so /v1 and the viewer share it. `treeFilter`: the first request to a
3// server that refuses tree:0 pays the 400 and the retry, later ones ask for blob:none directly. `blobWants`: a host
4// that refuses a multi-blob want list, so checkout asks for one blob at a time from then on.
5import type { Quirks } from 'ply/transport';
6import { PUBLIC_GIT_ORIGIN } from './public.ts';
8export type { Quirks };
10const MAX_ORIGINS = 256;
11const QUIRKS = new Map<string, Quirks>();
13export function quirksFor(origin: string): Quirks {
14 const known = QUIRKS.get(origin);
15 if (known) return known;
16 if (QUIRKS.size >= MAX_ORIGINS) QUIRKS.clear();
17 // ply's defaults (0.2.0 quirks are a total record); the transport updates this same object as it learns.
18 // The public namespace is Cloudflare Artifacts, which takes only blob:none (its 400: "only blob:none is supported").
19 // Known up front, a new isolate's first page there skips the tree:0 try: that refusal is cached per request body, so on
20 // a sha this colo had not served it went upstream, 1.0-1.7 s before the blob:none retry (runs sparse-ply and
21 // coldpack-ply on 2a4741c0: cff8743a…, c28d03a7…, d149bcd8…).
22 const q: Quirks = { treeFilter: origin === PUBLIC_GIT_ORIGIN ? 'blob:none' : 'tree:0', blobWants: 'many' };
23 QUIRKS.set(origin, q);
24 return q;
25}
27/** Tests only: forget what this process has learned (the node suites fake many servers under one origin). */
28export function resetQuirks(): void {
29 QUIRKS.clear();
30}
Diagnostics4 git calls · 356 ms
CallStatusSizeTime0356 ms
discover200152 B4 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200145 B · hit5 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=5 git.response.bytes=145 git.response.cache=HIT git.response.duration_ms=5 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=145 git.pkt.payload.max=76 git.ls_refs.count=2 git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020040 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=41349 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=526b305930b8ef382f2d7a1f9c0238730a585921 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=41349 git.pkt.payload.max=41254 git.sideband.band1.bytes=41253 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=61 git.pack.bytes=41253 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=ab60efef4b7243678c75de64a4386986ee885c1c git.pack.full=61Open pack map
fetch200950 B348 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=348 git.response.bytes=950 git.response.cache=MISS git.response.duration_ms=348 git.fetch.wants=19dce35919e70e130711e2d90e30db7c54cf97dc git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=950 git.pkt.payload.max=929 git.sideband.band1.bytes=928 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply-web.git
- Ref
- refs/heads/main
- Commit
- 526b305930b8ef382f2d7a1f9c0238730a585921
- cf-ray
- a5e3478e8dc9f4d4
- Request
- 244b5c2f…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format