Improve PDF performance - #4425
Open
svenseeberg wants to merge 1 commit into
Open
Conversation
timobrembeck
approved these changes
Jul 10, 2026
timobrembeck
left a comment
Member
There was a problem hiding this comment.
Looks good, thanks a lot! 🚀
A minor suggestion: the existing tests guard correctness but not the performance goal. A small test using pytest-django's django_assert_num_queries (or asserting the hash-path SQL does not select content) would protect it. Optional, but cheap insurance.
jonbulz
reviewed
Jul 21, 2026
jonbulz
left a comment
Contributor
There was a problem hiding this comment.
Looks nice, thanks! I think once @timobrembeck's comments are addressed this is ready to go. 👍
svenseeberg
force-pushed
the
fix/pdf-cache
branch
2 times, most recently
from
August 27, 2026 10:38
dd88471 to
6e54b41
Compare
Member
Author
|
Actually, the approach does not really work. Just deferring the content field does not really yield that much of an improvement. I'll try to improve the hash loop. |
svenseeberg
marked this pull request as draft
August 27, 2026 10:58
svenseeberg
force-pushed
the
fix/pdf-cache
branch
from
August 27, 2026 11:05
6e54b41 to
9879404
Compare
Member
Author
svenseeberg
force-pushed
the
fix/pdf-cache
branch
2 times, most recently
from
August 27, 2026 13:19
d70275b to
f07de47
Compare
svenseeberg
marked this pull request as ready for review
August 27, 2026 13:20
svenseeberg
force-pushed
the
fix/pdf-cache
branch
2 times, most recently
from
August 31, 2026 07:46
503626c to
b99d866
Compare
* Execute compute heavy page fetches only if no PDF exists * Add test to limit number of SQL queries on cache hit * Generate PDF file in temp dir and move to download dir when done to mitigate race condition between 2 processes
svenseeberg
force-pushed
the
fix/pdf-cache
branch
from
August 31, 2026 09:32
8f02be9 to
f222430
Compare
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.

Uh oh!
There was an error while loading. Please reload this page.