You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presigned urls are generated on every load -- the browser can't cache them.
Potential solutions
Either increase the expiration time and bucket them so the URLs don't change.
The big issue with this is security. At the moment we have a very short expiration time. We don't want users sharing these files.
Break apart the document into pages and serve them directly from S3.
We expect to do this anyways. And while it doesn't remove the issue at hand, it does minimize the effect. Pages are typically <100kb. A document of 100 pages, especially text heavy pages that aren't rasterized, will be much smaller as a PDF than this other approach.
While PDF.js currently supports piecemeal loading of PDFs, the efficacy depends on the document and if you're towards the end of the document, it will typically have to load the previous X pages.
Following may be able to help in the meantime, as it's brutal to download a PDF that's 50mb+ mozilla/pdf.js#8897
The text was updated successfully, but these errors were encountered:
Presigned urls are generated on every load -- the browser can't cache them.
Potential solutions
The big issue with this is security. At the moment we have a very short expiration time. We don't want users sharing these files.
We'd be downloading the file and serving it from some static URL. While not ideal, this could be the best solution as it also offers better security control. Requires bunch of infra/dev to get this working optimally https://9elements.com/blog/streaming-downloads-in-elixir--a-protocol-love-story/ https://dev.to/onpointvn/download-stream-large-file-with-hackney-in-elixir-539m https://hexdocs.pm/phoenix/Phoenix.Controller.html#send_download/3
We expect to do this anyways. And while it doesn't remove the issue at hand, it does minimize the effect. Pages are typically <100kb. A document of 100 pages, especially text heavy pages that aren't rasterized, will be much smaller as a PDF than this other approach.
While PDF.js currently supports piecemeal loading of PDFs, the efficacy depends on the document and if you're towards the end of the document, it will typically have to load the previous X pages.
Following may be able to help in the meantime, as it's brutal to download a PDF that's 50mb+
mozilla/pdf.js#8897
The text was updated successfully, but these errors were encountered: