perf: Optimize pdf generation performance by reducing file I/O by filzrev · Pull Request #10461 · dotnet/docfx
This PR intended to optimize PDF generation performance.
On current implementation.
1 . PrintHeaderFooterCore method is called every page numbers. And it access physical every times.
2. When header/footer is specified as string. It process try-catch operation every times.
What's changed in this PR
- Add
InvalidPathCharschecks to detectpdfHeaderTemplate/pdfFooterTemplateis HTML content or not. - Add
headerFooterTemplateCacheto reduce file I/O. - Rename
headerFooterCachetoheaderFooterPageCache