Free Support Forum - groupdocs.com

CustomInputHandler question


#1

Hi,


I’ve implemented a Custom InputHandler, but the performance war really terrible. I added some debug info and noticed the following set of requests made from the Viewer when I open a file (single one, first page displayed). What is the purpose of it? When I try to preview a file from e.g. DropBox, the file is downloaded 29 times! Can you make that more efficient? I have to implement some cache in that case, but it should be built in and optimized correctly.

Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file stream: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file stream: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file stream: <FILE_ID>
Get file stream: <FILE_ID>
Get file stream: <FILE_ID>
Get file stream: <FILE_ID>
Get file stream: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file stream: <FILE_ID>
Get file description: <FILE_ID>
Get file description: <FILE_ID>
Get file stream: <FILE_ID>
Get file description: <FILE_ID>


Thank you,
Mariusz

#2
Hello Mariusz,

This behavior was improved in the GroupDocs.Viewer v.2.8.0 for Java library. There a cache handler is separated. It controls resource caching, you can check it in the same way, the getFile method will be called only once.

The duplicate of the getFileDescription call is caused by the front-end implementation. For now the solution is to manually implement caching of the GroupDocsFileDescription per each GUID. This way data will be loaded from the storage only once and kept in the memory for subsequent calls.

It is planned to improve this behavior, but as it is connected with the change to the front-end it may take some time. Sorry for the inconvenience.