docs: PDF middleware svc-bypass + per-PO caching (merged #127/#128)
parent
2bf044404e
commit
09d9fb9f76
1 changed files with 5 additions and 1 deletions
|
|
@ -63,7 +63,11 @@ defaults (GST/EPFO stay stub-capable; PdfService skips token checks).
|
||||||
renders the app's `/api/po/<id>/export?…&svc=<token>` page (the token lets it
|
renders the app's `/api/po/<id>/export?…&svc=<token>` page (the token lets it
|
||||||
fetch without a user session), uploads the PDF to R2, and the app returns a
|
fetch without a user session), uploads the PDF to R2, and the app returns a
|
||||||
`mailto:` with a **7-day** presigned link. `APP_INTERNAL_URL` is the URL
|
`mailto:` with a **7-day** presigned link. `APP_INTERNAL_URL` is the URL
|
||||||
PdfService uses to reach the app (defaults to `NEXTAUTH_URL`).
|
PdfService uses to reach the app (defaults to `NEXTAUTH_URL`). The auth
|
||||||
|
middleware lets the `svc`-token export request through (`lib/pdf-export-auth.ts`
|
||||||
|
— without it the unauthenticated render is bounced to `/login`), and the rendered
|
||||||
|
PDF is **cached per PO** at a deterministic key: repeat sends reuse the stored
|
||||||
|
copy and only mint a fresh 7-day link, re-rendering only when the PO changed.
|
||||||
|
|
||||||
## Release & deploy flow
|
## Release & deploy flow
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue