react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Improvement: Preload Pages and Cache loaded pages

Open nikischin opened this issue 1 month ago • 0 comments

Before you start - checklist

  • [X] I understand that React-PDF does not aim to be a fully-fledged PDF viewer and is only a tool to make one
  • [X] 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 avatar Jun 03 '24 22:06 nikischin