Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Preload Pages and Cache loaded pages #1816

Open
2 tasks done
nikischin opened this issue Jun 3, 2024 · 5 comments
Open
2 tasks done

Improvement: Preload Pages and Cache loaded pages #1816

nikischin opened this issue Jun 3, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@nikischin
Copy link

nikischin commented Jun 3, 2024

Before you start - checklist

  • I understand that React-PDF does not aim to be a fully-fledged PDF viewer and is only a tool to make one
  • I have checked if this feature request is not already reported

Description

I just integrated this library in my App and it’s a huge upgrade compared to an iframe from a visual perspective. However, talking about performance it cannot compete with an iframe. And that is totally ok, though I was wondering if it would be possible in a future version to automatically preload the next page and keep the previous few pages in memory maybe? Because changing pages really takes some time and even when you go back to pages previously rendered they need to load again (without even showing the loading indicator and just being white).

Proposed solution

Automatically preload the next (or even next few) pages.
Keep previous few pages in Memory. Also preload the previous page if not in memory already.

Thank you!!

@nikischin nikischin added the enhancement New feature or request label Jun 3, 2024
Copy link
Contributor

github-actions bot commented Sep 2, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Sep 2, 2024
@nikischin
Copy link
Author

@wojtekmaj how can a Feature Request get stale? :)

@wojtekmaj
Copy link
Owner

I guess you could make a proxy component like OffscreenPage by rendering Page component, with text and annotation layers turned off, and customRenderer noop function? 🤔 You also have useDocumentContext hook which enables you to programatically get pages as you need.

@github-actions github-actions bot removed the stale label Sep 9, 2024
Copy link
Contributor

github-actions bot commented Dec 9, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Dec 9, 2024
@nikischin
Copy link
Author

So I guess this is nothing which could be added directly to this library then? :)

@github-actions github-actions bot removed the stale label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants