Skip to content

playground: speed up pdf loading#42

Merged
miguelgrc merged 1 commit into
inspirehep:masterfrom
miguelgrc:speed-up-pdf-loading
Jul 14, 2025
Merged

playground: speed up pdf loading#42
miguelgrc merged 1 commit into
inspirehep:masterfrom
miguelgrc:speed-up-pdf-loading

Conversation

@miguelgrc
Copy link
Copy Markdown
Contributor

@miguelgrc miguelgrc commented Jul 4, 2025

Closes cern-sis/issues-inspire#977

  • Now fetching PDFs from inspire when available, otherwise falling back to arxiv
  • PDFs for all papers are fetched immediately and in parallel when the LLM search response is received, and they are cached locally as blobs. While loading, they will be saved as pending.
  • When opening a paper, the PDF viewer will load all the PDFs from the cache in parallel into multiple pdf viewers, only one of them being visible (this is to avoid pdf rendering times when switching back and forth between papers). If any PDF is pending, it will just await it to avoid duplicate requests, otherwise (if for some reason it hasn't been fetched at all) it will retry, and if it doesn't work it will display an error.

With these changes PDFs load faster and switching back and forth between papers is almost instant.

Copy link
Copy Markdown
Collaborator

@PascalEgn PascalEgn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! just one small question.

Comment thread playground/src/components/pdf/PDFManager.tsx Outdated
@miguelgrc miguelgrc force-pushed the speed-up-pdf-loading branch from 9b9a87e to d4b4b41 Compare July 14, 2025 11:47
@miguelgrc miguelgrc merged commit fc9fe46 into inspirehep:master Jul 14, 2025
1 check 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.

Speed up PDF serving endpoint on playground

2 participants