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
@@ -1058,6 +1058,7 @@ Example `styles.css`: [section-code.md](./skills/iapl-block/resources/section-co
|
||||
| animations | `transform` / `opacity` only, the token durations (`duration-fast`, reduced motion built in) or `motion-reduce:`; IntersectionObserver for "is it on screen" | animating `height` / `top` / `margin`, `transition-all`, a `scroll` listener doing work per event |
|
||||
| client components | small, interaction only (§6.9); import from `@intecion/ipal-kit/client` freely — a page ships only what it renders (1.18.0) | a whole section `'use client'` |
|
||||
| data | the cached helpers of `lib/content` (`getSettings`, `resolveRoute`, `getSiteShell`…), `depth` as low as the page needs, `select` when you need one field, `cache()` around your own getters | `findGlobal` in a component without `cache()`, `depth: 2` "to be safe", a query per list item |
|
||||
| what grows | logs with a retention (consent log 1095 days, statistics 90; `forms: { submissionRetentionDays }` on the client's decision), `versions: { maxPerDoc: 20 }` where you turn versions on, unused media reviewed; `iapl-doctor --deep --only growth` ([performance.md](../performance.md) §6) | `maxPerDoc: 0`, submissions kept forever without a decision, a persistent volume on `.next` |
|
||||
| budgets | `e2e/performance.spec.ts` from the `iapl-performance` skill (`perfBudgets()` from `/doctor`): fails when a page gets slower | "it felt fast on my machine" |
|
||||
|
||||
Target on the built site (mobile, Lighthouse/PageSpeed): LCP < 2.5 s, CLS < 0.1, INP < 200 ms — the plugin's default
|
||||
@@ -1562,6 +1563,7 @@ bash .agents/skills/iapl-audit/scripts/audit.sh
|
||||
pnpm exec iapl-doctor # + --deep --url http://localhost:3000 on the built site
|
||||
node .agents/skills/iapl-seo-check/scripts/seo-check.mjs http://localhost:3000
|
||||
pnpm test:e2e e2e/performance.spec # the budget gate (iapl-performance) on the built site
|
||||
pnpm exec iapl-doctor --deep --only growth # what grows: sizes, versions, retention, old submissions, unused media
|
||||
pnpm generate:types && pnpm tsc --noEmit
|
||||
pnpm build # --webpack in the script; locally, not only dev
|
||||
# hardcoding and the field zoo in blocks
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: iapl-performance
|
||||
description: Makes and keeps an IAPL site fast — page loading (LCP image, fonts, nothing render-blocking, static rendering), elements (lazy below the fold, reserved space, click-to-load embeds), animations (transform/opacity, reduced motion, no scroll handlers), resources (only the JS a page uses, compression, no third-party request before consent), images (AVIF/WebP, sizes, upload limits) and the server (queries per render, depth, select, caching). Measures the built site, runs the doctor's performance group, and adds the budget gate that fails when a change makes the site slower. Use when building pages or blocks, before handing over, after an IAPL upgrade, and whenever "slow", PageSpeed, Lighthouse, Core Web Vitals, LCP, CLS or INP come up.
|
||||
description: Makes and keeps an IAPL site fast — page loading (LCP image, fonts, nothing render-blocking, static rendering), elements (lazy below the fold, reserved space, click-to-load embeds), animations (transform/opacity, reduced motion, no scroll handlers), resources (only the JS a page uses, compression, no third-party request before consent), images (AVIF/WebP, sizes, upload limits) and the server (queries per render, depth, select, caching); what grows in the database and on disk over the years (logs and their retention, form submissions, versions, KV, unused media, the image cache). Measures the built site, runs the doctor's performance group, and adds the budget gate that fails when a change makes the site slower. Use when building pages or blocks, before handing over, after an IAPL upgrade, and whenever "slow", PageSpeed, Lighthouse, Core Web Vitals, LCP, CLS, INP, a growing database or disk come up.
|
||||
---
|
||||
|
||||
# iapl-performance
|
||||
@@ -48,7 +48,19 @@ a change makes a page slower. PageSpeed Insights on the deployed site shows the
|
||||
- **Queries per render** (the reference gate counts them): over 30 for an ordinary page → a missing `cache()`, a
|
||||
`depth` too high, or a loop of `findByID`.
|
||||
|
||||
## 4. Before "done"
|
||||
## 4. What grows (performance.md §6)
|
||||
```bash
|
||||
pnpm exec iapl-doctor --deep --only growth # counts and sizes per collection, oldest records, versions, expired KV, unused media, disk
|
||||
```
|
||||
- Logs purge themselves (consent log 1095 days, statistics 90). Form submissions are kept unless
|
||||
`iapl({ forms: { submissionRetentionDays } })` — ask the client (personal data) and record it in AGENTS.md.
|
||||
- Versions: where you turn them on, `versions: { maxPerDoc: 20 }` (globals `max`); never `0`.
|
||||
- Unused media (`growth-media`): list them for the client; the plugin never deletes media or submissions by itself.
|
||||
- Coolify: no persistent volume on `.next` (the image cache starts empty on each deploy); database backups on the
|
||||
MongoDB resource.
|
||||
- Thresholds of the findings: `iapl-doctor.json` → `growth`.
|
||||
|
||||
## 5. Before "done"
|
||||
`iapl-doctor --only performance` without warnings (or each one silenced with a reason in `iapl-doctor.json`),
|
||||
the budget test green, and the numbers in `AGENTS.md` → "Project decisions" when the client accepted an exception
|
||||
(a heavy font, a third-party widget).
|
||||
|
||||
@@ -215,6 +215,7 @@ Mandatory set: AGENT.md §0b, skill **iapl-setup**; checks: **iapl-audit**, **ia
|
||||
| storage | `payload.config.ts` | `buildR2Storage(['media'], { s3Storage })` — always (without `R2_*` = local disk) | upload → URL from `R2_PUBLIC_URL` | storage.md |
|
||||
| e-mail | `payload.config.ts` | `email: mailAdapter()` (SMTP from the panel / Graph from env; also `panelSmtpAdapter`, `graphAdapter`, `sendEmail` from `/server`) | Site integrations → E-mail sending → **Send test** | email.md |
|
||||
| forms — action | `app/(frontend)/[locale]/actions.ts` | `'use server'`; `export const sendForm = createSubmitAction({ getCachedPayload, headers })` (`/server`) | submit → document in Form Submissions + e-mails | forms.md, skill **iapl-form** |
|
||||
| forms — retention | config (client decision) | `forms: { submissionRetentionDays: 365 }` (1.18.0; default: kept) | `iapl-doctor --deep --only growth-submissions` quiet; old submissions gone a day after the next submission | performance.md §6, forms.md |
|
||||
| forms — files | config + panel | `forms: { attachments: true }`; a **File** field on the form; an e-mail with fixed recipients in Forms → E-mails; `mailAdapter({ graph: { largeAttachments } })` when Graph must stay under 3 MB; Azure: `Mail.ReadWrite` limited to the forms mailbox for files of 3 MB and more over Graph | Test e-mail with "Attach a 10 MB test file" arrives; a submission with a PDF arrives with the attachment; nothing in Media | forms.md "Files", email.md "Attachments" |
|
||||
| forms — render | form block | `<RenderForm form={form} action={sendForm} locale={locale} texts={formTexts} classNames={formClasses} />` (`/rsc`) | form from the panel, Turnstile, message from Notifications | forms.md |
|
||||
| Turnstile | panel / env | `SiteProviders` wires `TurnstileProvider`; keys in Site integrations → Spam protection or env; server: `verifyTurnstile` (`/server`) | widget in the form; dashboard alert on a bad key | turnstile.md |
|
||||
|
||||
@@ -452,7 +452,7 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `createSubmitAction({ getCachedPayload, headers, … })` | `@intecion/ipal-kit/server` | Creates the server action `sendForm(formId, locale, values, token?)`: honeypot → `clientIp` → `submitForm` → text from Notifications; returns `SubmitActionResult`. Standard: `export const sendForm = createSubmitAction({ getCachedPayload, headers })` in `actions.ts` |
|
||||
| `submitForm({ payload, formId, data, files?, attemptKey?, turnstileToken?, ip?, locale?, maxPerMinute?, consentFieldName?, turnstileHostnames? })` | `@intecion/ipal-kit/server` | Server core (`consentFieldName`: argument → `iapl({ forms: { consentFieldName } })` → `'consent'`; `turnstileHostnames` rejects a token solved on another domain): rate limit → Turnstile → validation against the panel definition (+ GDPR consent) → saves the submission; returns a `SubmitFormResult` code, not text. Usually through `createSubmitAction`; server-only |
|
||||
| `submitForm({ payload, formId, data, files?, attemptKey?, turnstileToken?, ip?, locale?, maxPerMinute?, consentFieldName?, turnstileHostnames? })` | `@intecion/ipal-kit/server` | Server core (`consentFieldName`: argument → `iapl({ forms: { consentFieldName } })` → `'consent'`; `turnstileHostnames` rejects a token solved on another domain): rate limit → Turnstile → validation against the panel definition (+ GDPR consent) → saves the submission (and, with `forms.submissionRetentionDays`, deletes older ones at most once a day); returns a `SubmitFormResult` code, not text. Usually through `createSubmitAction`; server-only |
|
||||
|
||||
### Honeypot
|
||||
|
||||
@@ -878,6 +878,7 @@ Bin: `iapl-doctor` (`pnpm exec iapl-doctor [dir] [--json] [--md] [--strict] [--f
|
||||
| `runDeepProbe(ctx)` | `@intecion/ipal-kit/doctor` | `pnpm exec payload run …/dist/modules/doctor/probe.js` in the project → `DoctorStatus`. |
|
||||
| `collectDoctorStatus(payload)` | `@intecion/ipal-kit/doctor` | Read-only counts: `usersWithout2fa`, `pendingCookies`, `media` (images over `IMAGE_RULES`, 1.18.0), `plugin`, `node`. |
|
||||
| `PERF_BUDGETS`, `SERVER_BUDGET`, `perfBudgets(overrides)`, `overBudget(measured, budget)`, `IMAGE_RULES` | `@intecion/ipal-kit/doctor` | Performance budgets (1.18.0, performance.md): the defaults per profile (`mobile`, `desktop`: `lcp`, `cls`, `inp`, `tbt`, `jsBytes`, `cssBytes`, `fontBytes`, `requests`, `renderBlocking`, `thirdParty`) and per render (`queriesPerRender`); a project's own on top; the broken budgets of one measurement as lines (empty = within budget); the image limits (1.5 MB, 2560 px, AVIF/WebP). Types `PerfBudget`, `PerfMeasurement`, `PerfProfile`, `ServerBudget`. The gate: `iapl-performance/resources/performance.spec.template.ts` + `perf-lab.mjs`. |
|
||||
| `collectGrowth(payload)` → `GrowthStatus`, `growthRules`, `GROWTH_DEFAULTS`, `folderBytes(dir)` | `@intecion/ipal-kit/doctor` | What grows (1.18.0, performance.md §6): per collection documents, bytes (MongoDB) and the oldest record; versions per collection and global with their limit; `payload-kv` entries and expired ones; media no document points at (first 5000 documents) — counts only. The `growth` rules (`growth-size`, `-versions`, `-retention`, `-submissions`, `-kv`, `-media`, `-disk`) and their default thresholds (`iapl-doctor.json` → `growth`, type `GrowthThresholds`). |
|
||||
| `performanceRules` | `@intecion/ipal-kit/doctor` | The doctor's `performance` group (`perf-images-config`, `perf-fonts`, `perf-render-blocking`, `perf-embeds`, `perf-animations`, `perf-budgets`, `perf-live`, `perf-images`) — part of `doctorRules`. |
|
||||
| `buildDoctorEndpoint({ tokenVar, access })` | `@intecion/ipal-kit/doctor` | `GET /ipal/doctor` (`/api/ipal/doctor`): 404 until the token variable (default `IAPL_DOCTOR_TOKEN`, ≥ 32 chars) is set, Bearer token or `access`, rate-limited. Added by `iapl` unless `doctor: false`. |
|
||||
| `jobsRunAccess({ secretVar? })` | `@intecion/ipal-kit` | The rule iapl puts on `jobs.access.run` when the project writes none: `cronSecretMatches(req, process.env[secretVar])` or an admin with the second factor. Reuse it in your own rule: `run: (a) => jobsRunAccess()(a) \|\| myCheck(a)`. Type `JobsRunAccessOptions`. |
|
||||
|
||||
+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
|
||||
|
||||
@@ -70,6 +70,11 @@ returns counts only — never names, e-mails or values:
|
||||
{ "mail": { "graphEnv": false, "relay": { "connected": true, "disconnected": false, "nameReplaced": false, "state": "active" }, "replyAddress": true, "status": null, "transport": "relay" }, "media": { "images": 42, "oversized": 0, "tooWide": 0 }, "node": "v22.20.0", "openSignUp": [], "pendingCookies": 0, "plugin": "1.15.0", "staffOnOwnRoles": [], "staffOpenToOthers": [], "turnstile": null, "turnstileSecretFromEnv": false, "usersSetupClosed": 0, "usersWithout2fa": 0 }
|
||||
```
|
||||
|
||||
`growth` (since 1.18.0): per collection its documents, its size with indexes (MongoDB; `null` elsewhere) and the date
|
||||
of its oldest record; versions per versioned collection and global with their limit; `payload-kv` entries and how
|
||||
many have expired; media no document points at (`checked` documents read, at most 5000); the retention in days of
|
||||
each plugin log — counts, sizes and dates only.
|
||||
|
||||
`media` (since 1.18.0): how many images the upload collections hold and how many are over the plugin's limits
|
||||
(1.5 MB, 2560 px) — counts only, `null` without an upload collection.
|
||||
|
||||
@@ -146,6 +151,13 @@ Turn off: `iapl({ doctor: false })`. Adapt: `iapl({ doctor: { tokenVar: 'MY_TOKE
|
||||
| | `perf-budgets` | info | a project that runs Playwright has a performance budget test in `e2e/` (the `iapl-performance` skill's template) |
|
||||
| | `perf-live` | warning | (live) the home HTML is compressed, has no blocking `<script>` in `<head>`, preloads at most four fonts, its first image in `<main>` is not lazy, and is at most 150 KB |
|
||||
| | `perf-images` | warning | (deep) no stored image over 1.5 MB or 2560 px wide (`IMAGE_RULES`) |
|
||||
| growth | `growth-size` | warning | (deep) no collection over `growth.maxDocs` (200 000) documents or `growth.maxMB` (512, data + indexes, MongoDB) — [performance.md](./performance.md) §6 |
|
||||
| | `growth-versions` | warning | (deep) no collection or global keeps versions without a limit (`maxPerDoc` / `max`: 0), none over `growth.maxVersions` (50 000) |
|
||||
| | `growth-retention` | warning | (deep) a log with a retention (consent log, statistics, form submissions with `submissionRetentionDays`) holds no record older than it — its purge runs |
|
||||
| | `growth-submissions` | info / warning | (deep) form submissions kept without a retention; a warning when the oldest is over `growth.submissionDays` (730) |
|
||||
| | `growth-kv` | warning | (deep) at most `growth.expiredKv` (1000) expired entries in `payload-kv` |
|
||||
| | `growth-media` | info / warning | (deep) media no document or global points at; a warning over `growth.orphanedMedia` (25). From the first 5000 documents |
|
||||
| | `growth-disk` | info | `.next/cache/images` over `growth.imageCacheMB` (1024), the local `media/` over `growth.uploadsMB` (2048), on the machine the doctor runs on |
|
||||
| audit | `i18n-literals` | error / warning | from `iapl-audit`: hardcoded text in blocks (error) and components (warning), Polish literals in code (not the panel's `adminText()` / `{ en, pl }` labels in a schema file — the `iapl-audit` skill) |
|
||||
| | `audit:<title>` | as reported | every other `iapl-audit --quick` finding, one per file |
|
||||
| live | `live-reachable`, `live-health`, `live-noindex`, `live-seo` | error / warning | the URL answers; `/api/health` 200; production not noindex (staging must be); every `iapl-seo-check` error and warning |
|
||||
@@ -181,6 +193,7 @@ of the two exists, `iapl-doctor.json` when both do):
|
||||
|---|---|
|
||||
| `domain` | the production domain (dots allowed) — the base of the database names. Without it: a non-local `NEXT_PUBLIC_SERVER_URL`, else the folder name minus `-web` |
|
||||
| `launched` | the site is live: seeds must then name their records. Also true when "Project decisions" has a line with "launch" and a date |
|
||||
| `growth` | thresholds of the `growth` rules: `maxDocs`, `maxMB`, `maxVersions`, `submissionDays`, `expiredKv`, `orphanedMedia`, `imageCacheMB`, `uploadsMB` ([performance.md](./performance.md) §6) |
|
||||
| `layout.allow` | more top-level `src/` entries the convention allows |
|
||||
| `layout.frontend` | the folder that holds the site's pages, e.g. `src/app/(site)` — only for a layout the doctor cannot tell (two route groups with pages); the route group's name is otherwise free |
|
||||
| `rules.<id>` | `off` (silence), `severity` (`error` / `warning` / `info`), `reason` (**required** — an entry without one is ignored and reported), `until` (ISO date; after it the entry stops applying and the report says so), `files` (globs: only findings in those files). The id is the rule (`csp`) or an audit finding (`audit:collections-present`); `audit` covers all audit findings |
|
||||
|
||||
@@ -60,6 +60,7 @@ iapl({
|
||||
| `formOverrides` / `formSubmissionOverrides` | — | collection overrides (`fields` as a function + any collection settings) |
|
||||
| `emailLayout` | `false` | nice emails + the Site settings → E-mails tab |
|
||||
| `beforeEmail` | — | the form-builder's `beforeEmail` (after the layout, when `emailLayout`) |
|
||||
| `submissionRetentionDays` | — (kept) | 1.18.0: delete submissions older than this many days (checked at most once a day, after a new submission). Submissions are personal data — set it on the client's decision (AGENTS.md → Project decisions); the doctor's `growth-submissions` reports a site without one ([performance.md](./performance.md) §6) |
|
||||
| `consentFieldName` | `'consent'` | name of the GDPR consent field for `submitForm` / `createSubmitAction` (the call's argument wins) |
|
||||
|
||||
`payment` is always off — `fields: { payment: true }` does **not** turn it on (the value `true`
|
||||
|
||||
+48
-1
@@ -138,7 +138,54 @@ All in the `performance` group (`iapl-doctor --only performance`), warnings in 1
|
||||
|
||||
Silence a finding with a reason in `iapl-doctor.json` like any other ([doctor.md](./doctor.md)).
|
||||
|
||||
## 6. Shared with IAWL
|
||||
## 6. What grows — keeping the site and its database small over the years
|
||||
|
||||
Measured on the reference site after a full test run (MongoDB; average record without indexes): a consent record
|
||||
185 B, a form submission 647 B, a key-value entry 371 B, a page 9 KB. Every collection also carries 2–6 indexes.
|
||||
|
||||
| What | Grows with | What the plugin does (1.18.0) | What the project decides |
|
||||
|---|---|---|---|
|
||||
| Consent log (`consent-records`) | one record per banner choice | deleted after `retentionDays` (default 1095 — three years, the proof-of-consent period); the purge runs at most once a day, after a new record | `consentLog: { retentionDays }` |
|
||||
| Statistics (`stats-visits`, opt-in) | one record per visit | deleted after `retentionDays` (default 90), same purge | `stats: { retentionDays }` |
|
||||
| Form submissions | one per sent form (files are never stored: they go out by e-mail) | **kept** until deleted in the panel — unless `forms: { submissionRetentionDays }` is set (1.18.0), then deleted after that many days, once a day after a new submission | the retention: personal data, a client decision (AGENTS.md → Project decisions) |
|
||||
| Versions and drafts | every save | the plugin turns versions on nowhere; Payload keeps 100 per document by default (`maxPerDoc`, `max` for globals) | a lower limit where you turn versions on: `versions: { maxPerDoc: 20 }`; never `0` (unlimited) |
|
||||
| `payload-kv` | 2FA attempt counters (one per staff account), the mail service state (one per host), enrolment nonces | expired mail-service nonces are swept (at most once a day, when the next enrolment starts); counters and state are bounded by accounts and hosts | — |
|
||||
| Cookie review (opt-in) | distinct cookie names | upserted by name; a cookie that disappears is marked `gone`, not deleted (the history of what the site set) | delete old `gone` rows in the panel when the client agrees |
|
||||
| `payload-preferences`, `payload-locked-documents`, `payload-jobs` | panel users, open documents, queued jobs | Payload removes them with the user, on save, and on completion (`deleteJobOnComplete`); the plugin queues no jobs | — |
|
||||
| Media | uploads | Payload deletes the files (and R2 objects) with the document; nothing deletes media nobody uses | review `growth-media` findings in the panel |
|
||||
| `.next/cache/images` | each image × width × format (AVIF + WebP) | kept 31 days per variant (`minimumCacheTTL`); Next caps nothing by size | no persistent volume on `.next` in Coolify: every deploy starts empty |
|
||||
| ISR output | pages × languages | rewritten in place on each revalidation | — |
|
||||
| Logs | — | the plugin writes no files; it logs to stdout (Coolify keeps the container's log) | Coolify's log retention |
|
||||
|
||||
**Postgres and SQLite:** the same purges (one `DELETE … WHERE created_at < …`); no TTL indexes; the doctor reports
|
||||
counts but not sizes. A consent log without its migration records nothing and so never purges.
|
||||
|
||||
**What a project schedules:** nothing for the plugin's own logs — the purges run inside the site. A site that gets
|
||||
no new consent records (or submissions) for a long time keeps the old ones until the next one comes; the doctor's
|
||||
`growth-retention` rule says so. Database backups are the hosting's job (Coolify → the MongoDB resource → Backups).
|
||||
|
||||
**How to check:** `pnpm exec iapl-doctor --deep --only growth` (or `--url` with `IAPL_DOCTOR_TOKEN`): document
|
||||
counts, sizes (MongoDB), the oldest record, versions per collection and global, expired KV entries, media no
|
||||
document points at; and on the machine it runs on, the image cache and the local upload folder. Thresholds in
|
||||
`iapl-doctor.json`:
|
||||
|
||||
```json
|
||||
{ "growth": { "maxDocs": 200000, "maxMB": 512, "maxVersions": 50000, "submissionDays": 730, "expiredKv": 1000, "orphanedMedia": 25, "imageCacheMB": 1024, "uploadsMB": 2048 } }
|
||||
```
|
||||
|
||||
| Rule | Source | It means |
|
||||
|---|---|---|
|
||||
| `growth-size` | deep | a collection over `maxDocs` documents or `maxMB` (data + indexes, MongoDB) |
|
||||
| `growth-versions` | deep | a collection or global keeps versions without a limit, or over `maxVersions` |
|
||||
| `growth-retention` | deep | a log with a retention holds records older than it: its purge has not run |
|
||||
| `growth-submissions` | deep | form submissions kept without a retention (info; a warning when the oldest is over `submissionDays`) |
|
||||
| `growth-kv` | deep | more than `expiredKv` expired entries in `payload-kv` |
|
||||
| `growth-media` | deep | media nothing points at (info; a warning over `orphanedMedia`). Counted from the first 5000 documents |
|
||||
| `growth-disk` | static | `.next/cache/images` over `imageCacheMB`, the local `media/` folder over `uploadsMB` (info) |
|
||||
|
||||
None of these rules deletes anything; the plugin never deletes media or submissions by itself.
|
||||
|
||||
## 7. Shared with IAWL
|
||||
|
||||
IAWL (the WordPress line) holds its sites to the same numbers where the measurement is the same: the Core Web Vitals
|
||||
targets and lab profile, JS ≤ 250 KB, CSS ≤ 50 KB, fonts ≤ 250 KB and two families, requests ≤ 40 on the phone,
|
||||
|
||||
Reference in New Issue
Block a user