My site sends books as pdfs and their sizes are fairly large (3MB - 20MB). I’m trying to load them in chunks so the user can start viewing the pdf before the whole file loads. It’s working when I deploy locally, but not when I deploy through Netlify.
Any advice on what might be going wrong would be much appreciated! I’m new to Netlify, so advice on how to debug Netlify problems would also be great. I just discovered Netlify Dev and am checking that out.
I am using disableAutoFetch and disableStream so that pdf.js only loads the content the user is viewing.
Below you can see this working when I run locally. The pdf file is transferred in small chunks, mostly around 60kb. The pdf is viewable around 1.3s and a total of 1.2MB is transferred.
And below you can see this not working when I deploy on Netlify. The pdf is loaded as one 4.5MB file. The pdf isn’t viewable for around 4s and a total of 5.1MB is transferred.
And finally, below you can see the documentation for the pdf.js settings I’m using.