fixup! diigo-cache: the public page only reads

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 2a1942fc2a
commit 164d3cb8cb
2 files changed
+62 -81

No files matched your search

+13 -15
View File
@@ -1,14 +1,6 @@
/**
* @file the cache Durable Objects' logic: `DiigoCacheLogic` (public+private
* items) and `PublicCacheLogic` (public-only items, widely shared). Logic
* only: each requires its {@link Clock}; the worker's entry module
* (src/index.ts) is the edge that makes the live one and exports the
* runtime-constructed `DiigoCache`/`PublicCache`. They are independent
* and work the same way ({@link PagedCache}): pages are the unit of
* caching; a hit is answered from `ctx.storage.sqlite` with no diigo call;
* a miss asks the webapp instance in the cache's wiring and etches the
* page. The only difference is what each keeps: the public cache drops
* private rows *before* etching ({@link publicOnly}).
* @file the cache Durable Objects' logic: a private and a public page cache.
* The runtime classes are made at the edge (src/index.ts).
*/
import { DurableObject, RpcTarget } from "cloudflare:workers";
@@ -112,11 +104,17 @@ export type CacheEnv = {
};
/**
* the shared page-cache behavior. The webapp-instance id in the wiring
* authorizes diigo reads (the cookie rides in that DO's storage); the id
* this DO is addressed by authorizes cache reads. Neither is logged.
* `setup()` persists the wiring (webapp's configure pattern); `page(n)` is
* the read path; subclasses choose what to `keep` of a fetched page.
* the shared page-cache behavior; {@link DiigoCacheLogic} and
* {@link PublicCacheLogic} are independent and differ only in what they
* `keep` of a fetched page (the public one drops private rows before
* storing, {@link publicOnly}). Pages are the unit of caching: a hit is
* served from storage with no diigo call; a miss asks the webapp instance
* in the cache's wiring and stores the page.
*
* The webapp id in the wiring authorizes diigo reads (the cookie rides in
* that DO's storage); the id this DO is addressed by authorizes cache
* reads. Neither is logged. The {@link Clock} is required: time comes from
* the edge that constructs the DO.
*/
abstract class PagedCache extends DurableObject<CacheEnv> {
#step = 0;