opening a large pdf files on web

后端 未结 5 1506
终归单人心
终归单人心 2021-01-15 12:56

I have a 27MB pdf file which is hosted in web. When I try to open it, it takes times to open it. So Is there any way where I can view this large pdf file a bit fast. I guess

5条回答
  •  臣服心动
    2021-01-15 13:33

    Two possible workaround would be:

    If the PDF doesn't usually change you can set an cache expiry for the resource (set in the response), so that when clients opens the pdf/view the resource is cached in their browser, will reduce load time on their second visit (depending on how long it expires of course)

    Another option, if it is possible, try to load the pdf file asynchronously. That is load the other contents of your web page first, then your pdf will be loaded after.

    Or you can do a combination of both.

提交回复
热议问题