Azure storage requests slow

We appreciate the team’s help on getting Groupdocs cache working from Azure storage.


While the cache functions, it is very slow. It appears that requests are single threaded, each page is being called one at a time. So files with many pages take a very long time to load. Our developer thinks multi-threaded requests would greatly speed up the load time.

Can you look into how these requests are being made and see if there’s a way to speed them up?


Hello,

We are sorry to hear that you have this issue. We need to know more details about the issue in order to investigate, reproduce and resolve it. So, please tell us the next things:

1. These “lags”, which you’ve described, they occur when you open the document using the GroupDocs.Viewer at the first time? Or they are still present when you are opening the document at the next time, when it was previously opened and cache is present?
2. Please provide a part of source code with the GroupDocs.Viewer widget (Viewer.ClientCode().TargetElementSelector…).

Thanks and waiting for your reply.

  1. They are present every single time. Yes there’s a cache. If there’s no cache it takes INCREDIBLY long to generate one. We’re talking 3-20 minutes depending on the size. The generation process is also highly resource intensive. Thankfully we have all the files cached and on Azure storage.

    2. Here’s the code:
    Dim ViewerHtml = Groupdocs.Web.UI.Viewer.ClientCode() _
    .TargetElementSelector("#TheDocumentViewer") _
    .FilePath(Filename) _
    .ShowThumbnails(True) _
    .OpenThumbnails(False) _
    .ShowDownload(False) _
    .ShowPrint(False) _
    .UsePdfPrinting(False) _
    .ShowFolderBrowser(False) _
    .ShowViewerStyleControl(False) _
    .ShowPaging(False) _
    .ShowOnePageInRow(True) _
    .SupportTextSelection(True) _
    .UseHtmlBasedEngine(False) _
    .UseInnerThumbnails(False) _
    .ToString()

Hello,


Thank you for coming back with the code example. We have checked your code and we can advise you to change .UseHtmlBasedEngine(False) to .UseHtmlBasedEngine(True) and add .PreloadPagesCount(int numberOfPages).

Also the reason of the issue could be a slow internet connection, please download this document from the Amazon server manually and put it to the machine where GroupDocs.Viewer is located, and then try to display it.

If 40sec-delay still be present, it means that the reason of such “lags” is in the GroupDocs.Viewer. In that case please send us the document, our developers will investigate it and will try to fix this behaviour.

However, if GroupDocs.Viewer will display the document that is located on the same machine noticeably faster, that 40 seconds, then that means that the reason is a slow internet connection. GroupDocs.Viewer cannot display the document while it is still downloading, because document, in contradistinction to video or audio, is not a streaming content. For removing this delay you should develop something like ahead-of-time caching, when required documents are downloading to the local server not in the moment when they are required by the end-users, but before this moment (for example, on the project startup). Ahead-of-time caching is also supported by the GroupDocs.Viewer, please investigate the article “Description of GroupDocs Viewer DocumentCache class”.