Repository navigation
Reuse generated PDF downloads in existing object storage - #12
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Public PDF downloads currently rebuild the document and fetch artwork on every request. Generate on first download and reuse the bytes in the existing R2/S3 storage while keeping current credential lookups and
Cache-Control: no-storeon both PDF routes.The cache fingerprints all resolved PDF inputs plus a renderer version, so lifecycle, recipient, expiry, artwork URL, and public URL changes select a fresh render. One replaceable JSON/base64 object per assertion bounds retained versions; reuse expires after 24 hours so artwork at an unchanged external URL can refresh. Expected artwork that could not be embedded is never cached. Cache read/write failures still return a freshly rendered PDF.
No new infrastructure, database schema, challenge flow, or background jobs. Concurrent cache misses can render more than once; stored fingerprints prevent a different version from being reused.
CI fixes: update Zod to 4.6.6 and Undici to 7.30.1 / 6.29.1 for the production security audit, pin both CI jobs to Ubuntu 24.04, and surface browser errors from the production sign-in smoke test.
Validation:
pnpm audit:prod(no high or critical advisories)pnpm format:checkpnpm test:scriptspnpm check:node-runtimepnpm lintpnpm typecheckpnpm test: 265 files passed, 64 skipped; 1,915 tests passed, 256 skipped.Related: Discussion #10 (internal PDF reuse only).