Skip to content

Reuse the cached renderer font in browser starters - #21

Merged
krflol merged 1 commit into
mainfrom
perf/starter-font-cache
Oct 6, 2026
Merged

krflol merged 1 commit into
mainfrom
perf/starter-font-cache

Conversation

@krflol

@krflol krflol commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The browser and React starters requested Inter through an unversioned CSS URL while the PDF worker requested the same bytes with ?v=0.3.0. Match the interface font URL to the pinned renderer URL so Chrome can reuse its cached response.

With fresh browser contexts and a local HTTP server sending Cache-Control: public, max-age=3600, Chrome 154 reduced font GETs from two to one in each starter. Firefox 155 and Playwright WebKit 26.6 still made two; the saving is browser-dependent. Each local font response was 876,576 bytes. The current GitHub Pages response uses gzip and has a 461,262-byte content length. These are transfer observations, not a general loading-time benchmark.

Validation: both production builds passed, including React's TypeScript check. All 12 before/after browser/app combinations loaded the interface font and produced the same invoice PDF SHA-256 with expected extracted text. The existing Chrome suites passed 23 browser-starter checks and 35 React checks, including downloads, editing, cancellation, mobile layouts, and cleanup. Full logs, requests, PDFs, and screenshots are retained locally.

@krflol
krflol merged commit bbb140f into main Oct 6, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant