What grows: the doctor's growth group (sizes, versions, retention, submissions, KV, unused media, disk) with thresholds, expired mail-service nonces swept, opt-in forms.submissionRetentionDays, docs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6b16b9f933
commit
8991867e01
+37
-1
@@ -140,9 +140,45 @@ the proxy does no database work; the 434 KB cookie database is loaded only by a
|
||||
8. **Doctor performance rules: warnings now, errors later?** In 1.18.0 they warn (as asked); `perf-live`
|
||||
uncompressed HTML and `perf-images` could become errors in 1.19.0.
|
||||
|
||||
## Growth review (owner's addition, 2026-12-01): what swells the site and its database
|
||||
|
||||
Measured on the reference site (MongoDB 7) after the full reference suite as traffic: 15 collections, the largest
|
||||
`pages` (15 × 9 KB); consent record 185 B, form submission 647 B, KV entry 371 B on average, plus 2–6 indexes per
|
||||
collection. `pnpm exec iapl-doctor --deep --only growth` on it: 2.6 s, two infos (3 submissions without a
|
||||
retention; 1 of 17 media unused — `logo-example-studio-1.webp`, a duplicate logo a test uploaded).
|
||||
|
||||
| Store | Today (1.17.2 defaults) | file:line | 1.18.0 |
|
||||
|---|---|---|---|
|
||||
| consent-records | purged after 1095 days, once a day per process, only after a new record; one unbounded `deleteMany` | `consent/consentLog.ts:124,161`, `shared/purge.ts:16` | retention recorded for the doctor; `growth-retention` reports a purge that has not caught up |
|
||||
| stats-visits (opt-in) | purged after 90 days, same mechanism | `stats/endpoint.ts:53,153` | same |
|
||||
| form-submissions | **no retention, nothing deletes them**; files never stored | `forms/submitForm.ts:324` | opt-in `forms.submissionRetentionDays` (default: kept); `growth-submissions` |
|
||||
| payload-kv: mail-service nonces | expiry checked only on read: a nonce whose call-back never came stayed for good | `email/relay/store.ts:174` | expired nonces swept (once a day, at the next enrolment) |
|
||||
| payload-kv: 2FA counters, relay state | one per staff account / host; never deleted | `security/totp/verifyLimit.ts:84`, `relay/store.ts:114` | left alone: bounded; a sweep could race a live verify |
|
||||
| versions | the plugin turns none on; Payload keeps 100 per document / global | `payload/dist/collections/config/sanitize.js:172` | `growth-versions` (0 = unlimited, or over 50 000) |
|
||||
| cookie-review (opt-in) | upsert by name; `gone` rows kept | `consent/scanner/scan.ts:297` | documented |
|
||||
| payload-preferences / locked-documents / jobs | Payload cleans them; the plugin queues no jobs | — | — |
|
||||
| media | deleted with the document (disk and R2); nothing finds unused media | `storage/buildR2Storage.ts:140` | `growth-media` (counts, never deletes) |
|
||||
| `.next/cache/images` | 31-day TTL, no size cap | `storage/buildImagesConfig.ts:56` | `growth-disk` (info); Coolify: no volume on `.next` |
|
||||
| logs | the plugin writes no files | — | — |
|
||||
|
||||
Postgres / SQLite: the same purges through Drizzle's `deleteMany`; no TTL indexes; sizes not read (counts only).
|
||||
|
||||
### Growth — for the owner (yes / no)
|
||||
|
||||
9. **A default retention for form submissions** (e.g. 365 days) on every site, existing ones included. Deletes
|
||||
data on live sites on their next submission. Recommendation: no default; the agent asks the client
|
||||
(`submissionRetentionDays`) and the doctor reports sites without one — or yes with 730 days and a loud upgrade note.
|
||||
10. **MongoDB TTL indexes** for the consent log and statistics (expire `createdAt` / `lastAt` after the retention),
|
||||
so the purge runs even when no new record comes. Same records deleted as today, sooner on a quiet site; one index
|
||||
build per site at start. Recommendation: yes for 1.19.0 (opt-out), Mongo only.
|
||||
11. **Delete `gone` cookie-review rows after a year.** Deletes the scanner's history. Recommendation: no.
|
||||
12. **A media clean-up action in the panel** (list the unused media, delete after confirmation). Recommendation:
|
||||
yes, as a panel view — never automatic.
|
||||
13. **`maxPerDoc: 20`** in the reference and the starter wherever versions get turned on (none today). Recommendation: yes (no data deleted until a document is saved again).
|
||||
|
||||
### Shared with IAWL
|
||||
|
||||
Proposed for both products (performance.md §6): the Core Web Vitals targets and the lab profile; JS ≤ 250 KB,
|
||||
Proposed for both products (performance.md §7): the Core Web Vitals targets and the lab profile; JS ≤ 250 KB,
|
||||
CSS ≤ 50 KB, fonts ≤ 250 KB and two families, ≤ 40 requests on the phone, one render-blocking stylesheet, no
|
||||
third-party origin before consent; images ≤ 1.5 MB and ≤ 2560 px at upload, AVIF / WebP in the width the screen
|
||||
needs, one high-priority LCP image, lazy below the fold. Not shared: the database budget (MongoDB queries per render
|
||||
|
||||
Reference in New Issue
Block a user