Free Support Forum -

Document Viewer not removing old entries



we are using groupDocs Viewer for .Net(Assembly version
we are facing an issue of server ran out of space due to not removal of Old cached document.

The source Code which we used to remove old cached document is here.

DocumentCache cache = new DocumentCache(Server.MapPath("~/License/GroupDocsViewer.lic"), Server.MapPath()); //Example: \<MyServerName\AppName\CacheFolder>
TimeSpan olderThan = new TimeSpan(60, 0, 0, 0); // Time Span. example 60 Days.

cache.RemoveOldEntries(olderThan, null); // no logfile path is passed.

These code execute on OnLoad event of my application.
No exception is occurs when code execute but no data entries remove from the caching folder.

we need automation of removal caching after a fixed interval of time.

let me know if you need any more information.

Please suggest all possible option to fix this.


Thank you for your posting and using GroupDocs.Viewer.

We rechecked RemoveOldEntries method and it works well for us. For test purpose we added it in HomeController class in section Index() ( please check the code here and each time when the index page is loaded this method is called. Also as you can see in the code that we added the path to a log file, to make sure that this method works. After this, we run our MVC application and check this log file. Now we can see which files were found and removed ( .

Please make sure that you use this method just as we do and try it again. Also please check the log file that would ensure that your cache files were found. Please do not forget that the rootStoragePath path parameter ( in new DocumentCache(string licensePath, string rootStoragePath) should be the same path that you configured in SetRootStoragePath method .

Also please be sure that you have entries in the cache that are older then period you set in the method.


Best regards,
Evgen Efimov
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+