Viewer.SetRootStoragePath() method creates temp folder

Hi,


  • I set Viewer.SetRootStoragePath(“mypath”) in global.asax.
  • I have one documents to that path which is pdf with 29 pages and size is 388kb but when i read this documents with GroupsDocs.Viewer it creates temp folder which is 67MB.
  • so what if I don’t want to cache my documents.
  • Is There anyway that i can avoid Viewer.SetRootStoragePath(“mypath”) method.
  • Because each time my docs will come from different location.So how to resolve this .
Please Help Me Outttt!!
thank you

Hello Hiren,

Thank you for your interest in GroupDocs.

GroupDocs.Viewer for .NET requires the root storage, it should be initialized by using the “Groupdocs.Web.UI.Viewer.SetRootStoragePath()” method. It is not necessary to invoke this method in the Global.asax file, but it should be invoked before the first use of the Viewer widget (Viewer.ClientCode()).

GroupDocs.Viewer requires the cache in any way, you cannot disable it. However you can delete it manually every time after displaying a document. In the article “Description of GroupDocs Viewer DocumentCache class” you can find how to use the “RemoveOldEntries” method.

“temp” folder is a single place where all GroupDocs.Viewer-related internal and intermediate files are stored. Does not matter where is located the target document, in which folder, is it a file or a stream, or you receive a document from the remote location (using the “Url” method). So there is no problem related to the “each time my docs will come from different location” because GroupDocs.Viewer doesn’t create a distinct “temp” folder for each document - there is a single “temp” folder for all documents, and this folder is located inside a root storage folder, that should be initialized using the “Viewer.SetRootStoragePath()” method.

About cache size - it depends on document type, current scale and a lot of other factors. But, please, try to remove old cache (manually, just delete the “temp” folder), and then use the “.UseHtmlBasedEngine(true)” method in the Viewer widget. This method enables HTML-based rendering mode, which usually generates cache files with much lesser size.

If you will have another questions, or if you do not fully understand something of what I wrote above, or you need some clarifications, or something else, please feel free to contact us.