Repository navigation
Reuse the cached renderer font in browser starters - #21
Merged
Merged
Conversation
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.
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.