On 10/2/14, 3:01 PM, alQemist wrote:
> The biggest impediment for us is the load time - our content is mostly magazines and catalogs and the initial load times before rendering prevent it from be a viable option for our readers.
>
> I am wondering if anyone has experimented with incremental loading or preloading pdf into cache using jQuery methods or XMLHTTPRequest. Seems that PDFs loaded a second time seem to load faster - I am thinking they are loaded from cache....
>
For non-web optimized PDFs, the important data is located at the end of
a PDF file. By default, PDF.js is trying to use HTTP range requests to
read this tail and any other important data to display first or visible
page(s).
If your web server or script that serves PDFs is not setup to handle
HTTP range requests, PDF.js will continue progressively fetching the
data until reaches the end. Some browsers (such as Safari) has defects
in handling/caching HTTP range request -- we disabled those there.
Recently we improved speed of downloading of entire files for the
browsers (Firefox) that support progressive binary data loading
(XMLHttpRequest cannot do that by default), and currently working on
supporting experimental Streams API.
Thanks,
Yury Delendik