Starting a fill no longer POSTs the cache id to /_fill. Instead: - the created page links the cache's webkey, /cache/#<cache id>: a skeleton page, the same for every key, that reads the key from the fragment (never sent to the server or in a Referer) - its script trades the key in-band for a capability over Cap'n Web at /api: CacheApi.cache(key) returns a CacheCap facet (fill, status, fingerprint, the public companion's fill) and never the DO's wiring methods; malformed and unknown keys get one refusal that never echoes the key, and each refusal is logged without it - then calls startFill(): trade and call pipeline into one round trip - the worker serves capnweb's browser build itself at /_capnweb.js (a wrangler Text rule), so no third-party script sits beside the key The /_fill route and its forms are gone. Tests run the real capnweb client against the worker (fetch routed to worker.fetch). Generated-by: Claude Opus 5.5
27 lines
816 B
JSON
27 lines
816 B
JSON
{
|
|
"$schema": "node_modules/wrangler/config-schema.json",
|
|
"name": "diigo-cache",
|
|
"main": "src/index.ts",
|
|
"compatibility_date": "2026-09-29",
|
|
"observability": { "enabled": true },
|
|
// capnweb's browser build, served as text at /_capnweb.js (the worker
|
|
// itself imports capnweb's workerd build as code)
|
|
"rules": [{ "type": "Text", "globs": ["**/capnweb/dist/index.js"], "fallthrough": true }],
|
|
"services": [
|
|
{
|
|
"binding": "WEBAPP",
|
|
"service": "webapp",
|
|
"entrypoint": "WebAppFactory"
|
|
}
|
|
],
|
|
"durable_objects": {
|
|
"bindings": [
|
|
{ "name": "CACHE_DO", "class_name": "DiigoCache" },
|
|
{ "name": "PUBLIC_DO", "class_name": "PublicCache" }
|
|
]
|
|
},
|
|
"exports": {
|
|
"DiigoCache": { "type": "durable-object", "storage": "sqlite" },
|
|
"PublicCache": { "type": "durable-object", "storage": "sqlite" }
|
|
}
|
|
} |