fixup! diigo-cache: invalidate the last N days of cached pages

Docs per the docs-files-api skill: a 1–2 line @file; what a declaration is or does in JSDoc on it, not in // comments or the file header.

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-10-07 09:34:06 -05:00
1 parent 76b9ed1494
commit 2a1942fc2a
2 files changed
+24 -28

No files matched your search

+11 -15
View File
@@ -1,17 +1,4 @@
/** /** @file the Cap'n Web API at /api: trade a cache's webkey for a capability. */
* @file the Cap'n Web API at /api: trade a cache's webkey for a capability.
*
* The browser holds the key in a URL fragment (`/cache/#<key>`, see
* docs/webkeys.md), so it never reaches the server in a URL. The skeleton
* page passes it *in-band* — `api.cache(key)` — and gets back a stub for a
* {@link CacheCap}: a facet exposing only what the holder should do (fill,
* status, the public companion), never the DO's wiring methods.
* Authorization is in-band, so cross-origin calls are safe (capnweb's
* note on `newWorkersRpcResponse`); every argument is checked at runtime,
* since TypeScript types are erased on the wire.
*
* @see https://github.com/cloudflare/capnweb
*/
import { RpcTarget } from "capnweb"; import { RpcTarget } from "capnweb";
import type { DiigoCacheLogic, FillStatus, PublicCacheLogic } from "./cache.js"; import type { DiigoCacheLogic, FillStatus, PublicCacheLogic } from "./cache.js";
@@ -97,7 +84,16 @@ export class CacheCap extends FillCap {
} }
} }
/** the main interface at /api */ /**
* the main interface at /api. The browser holds a cache's key in a URL
* fragment (`/cache/#<key>`, docs/webkeys.md), so it never reaches the
* server in a URL; the webkey page passes it *in-band* to {@link cache}
* and gets back a {@link CacheCap}. With authorization in-band,
* cross-origin calls are safe (capnweb's note on `newWorkersRpcResponse`);
* arguments are checked at runtime, since types are erased on the wire.
*
* @see https://github.com/cloudflare/capnweb
*/
export class CacheApi extends RpcTarget { export class CacheApi extends RpcTarget {
#env: ApiEnv; #env: ApiEnv;
+13 -13
View File
@@ -1,17 +1,17 @@
/** /** @file the webkey page at /cache/: a skeleton the key's holder drives over /api. */
* @file the webkey page at /cache/ — a skeleton, identical for every key
* (docs/webkeys.md): the key rides the URL fragment, which browsers never
* send to the server or in a Referer. The inline module reads it, trades
* it for a capability (`api.cache(key)`, Cap'n Web over /api, in-band),
* and drives the fill job. Each round trip is its own HTTP batch session:
* calls made before an await travel together.
*
* Without a fragment, the page is a login form a password manager fills
* (petname as username, cache id as password). Its inputs have no
* `name`, so a native submit (script failed) sends nothing; the key
* stays in memory, out of the address bar and history.
*/
/**
* the webkey page, identical for every key (docs/webkeys.md): the key
* rides the URL fragment, which browsers never send to the server or in a
* Referer. Its script reads it, trades it for a capability
* (`api.cache(key)`, Cap'n Web over /api, in-band), and drives the fill
* job. Each round trip is its own HTTP batch session.
*
* Without a fragment it is a login form a password manager fills
* (petname as username, cache id as password). The inputs have no
* `name`, so a native submit (script failed) sends nothing; the key stays
* in memory, out of the address bar and history.
*/
export const CACHE_PAGE_HTML = `<!doctype html> export const CACHE_PAGE_HTML = `<!doctype html>
<html><head><meta charset="utf-8"><meta name="referrer" content="no-referrer"> <html><head><meta charset="utf-8"><meta name="referrer" content="no-referrer">
<title>diigo cache</title></head> <title>diigo cache</title></head>