0

I have large PDFs that are linearized for "fast web serving".

However, it still looks like they are fully downloaded before they can be viewed. From what I have read, linearized files require byte-serving to take advantage of the linearization.

I can't seem to find how to do this on Nginx. Best I could find was this Nginx doc on "byte-range-caching", and I'm not sure if that's the same thing I'm looking for: https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/

This seems to require server-side file caching which I don't have set up as of yet. Is caching a requirement to do byte-streaming with Nginx?

geochanto
  • 157
  • 9
  • You shouldn't have to do anything special to nginx to serve a linearized PDF. What is the actual problem you are having? – Michael Hampton Aug 20 '19 at 17:22
  • @MichaelHampton You could be right... I'm noticing that page 1 of the PDF actually gets loaded immediately. Rest of the pages wait till the file is entirely loaded. This is not optimal. I don't know whether this is due to how the file is served, or whether linearization is messed up due to saving and re-saving the file. – geochanto Aug 21 '19 at 00:21
  • That's exactly what linearization does. – Michael Hampton Aug 21 '19 at 02:55
  • @MichaelHampton ok, but I was hoping I could fine-tune that a little better. For example, if a user wants to see page 2, or any other specific page for that matter - I would like to prioritize downloading that part of the document when user skips to that page - rather than having to wait for the entire rest of the file to load (i.e. everything else other than page 1). Right now it just splits it into page 1, and then all the rest together. – geochanto Aug 22 '19 at 03:23
  • 3
    Supposedly that already happens if the PDF is linearized. In practice it doesn't work very well, and never really has. Good luck. – Michael Hampton Aug 22 '19 at 06:00

0 Answers0