Free Support Forum -

About the caching and the rootstoragepath



I have some questions regarding the groupdocs products, viewer, annotation, signature, and comparison specifically for the .NET libraries:

1. Is it possible to some how to clear the cache after use because large files and also multiple files would take a lot of memory ?
2. Is it possible to not define or to define multiple storage paths for the method SetRootStoragePath?
3. Is it possible to speed up the displaying of large files? (example: 11Mb pdf takes about 7 minutes for displaying in Viewer)




Hello Goran,

Thank you for your interest in GroupDocs.

1. Yes. There is a “Groupdocs.Web.UI.DocumentCache” class, and it contains a “RemoveOldEntries” method, which removes all cache, which is older then the specified datetime. This class is present in all GroupDocs products, except the GroupDocs.Conversion for .NET.

2. At a single moment of time there can be one and only one root storage. You can change different root storages during different moments of time, but you cannot have multiple root storages simultaneously, in one moment. However, there are two exceptions. First of all, for the GroupDocs.Viewer you can develop and involve your own storage provider, which implements the “Groupdocs.Storage.IFileStorage” interface and implements the root storage logic as you want. And secondly, the “SetRootStoragePath” method has a third parameter - “storePerRequest”. If “true”, the root storage path and working directory path are stored separately for each request. Otherwise, the paths are shared between requests.

3. There are several techniques, they depends on specific file format and its content. First of all, you can create a cache for the file before it will be displayed, using the previously mentioned “Groupdocs.Web.UI.DocumentCache” class. Also you can use the “.PreloadPagesCount(1)” method in the GroupDocs.Viewer widget. But, in order to answer more accurate we may need more info about the file and its content.

If you will have more questions please feel free to contact us.