Free Support Forum -

Store Cache on amazon S3 & generate cache on demand

Hi, i am using Group docs Viewer 17.10, i want to cache documents on S3 rather then on local storage, & generate html cache using code rather then onDemand using viewer, can anyone guide me on this ?


Thanks for posting your inquiry. GroupDocs.Viewer allows you to manage the cache on cloud storage using ICacheDataHandler interface. Please visit this article for the guidance on the implementation and usage of ICacheDataHandler interface. Hope it helps.

Thanks usman, can i get any sample plug & play example ? i need help exactaly on these if you can guide me on this it would be great
1- group docs cache generation on demand
2- instead of cache on local server we want to store html generated cache on s3
3- to increase speed we want to pick data from cache rather then doing on run time
is those steps possible i am using using group docs 17.10


Thanks for your response. You can download this sample application for the guidance on how to implement ICacheDataHandler to use AmazonS3 for caching. Please don’t forget to restore NuGet packages and update the bucket name and AWS credentials. Hope it helps.

Yes, you can simply turn the cache on & off using ViewerConfig.UseCache property. For details, please visit this article.

You can achieve this by implementing ICacheDataHandler interface as demonstrated in the sample application.

You can speed up the document processing time using ViewerConfig.UseCache = true. With this configuration, when the document will be rendered for the second time, API will not process the whole document again. Instead, it will pick up the files from the cache directory.

Thanks it was great help :slight_smile:


You are always welcome.

Another question is it possible to delete a particular document cache stored on S3 using code, not full cache delete but delete a specific document cache using Code, code samples are welcomed


Thanks for coming back to us. Currently, GroupDocs.Viewer for .NET does not support removing cached files for a specific document. However, you can clear the cached files which are older than a specified time span. For details, please visit this documentation article.

We’ll also discuss your scenario to check if there is any possibility to support clearing cache for a specific document in upcoming versions. For this, we have logged it in our Issue Tracking System (with ID: VIEWERNET-1445). In case of any further updates, you will be notified here.

Hi is there any functionality to reload/Refresh viewer in .NET ?


Thanks for coming back to us. Would you please elaborate your question in detail? Furthermore, please also mention the scenario in which you would need this functionality. We look forward to hearing from you.

Thanks usman sorry was away i managed to handle that thing by myself i was wondering is there any UI functionality to refresh cache, like delete existing one & generate new that was scenario

Now i am getting issue while reading email with attachments,its not displaying emails with attachment & viewer say loading your contents & it keeps loading, by further investigation i have found
var attachmentInfo = _htmlHandler.GetDocumentInfo(attachmentPath), that call is inside function
ViewDocumentAsHtml you can check in MVC showcase project as well & this is trying to read attachment from input document rather then the cache document generated & throws exception, i can send that email as well

can you guide me on this why its checking input on S3 rather then cache ?


It’s good to know that you have handled it.

We apologize for the inconvenience you are facing. Please share with us the problematic email file so that we can investigate the issue at our end. We look forward to hearing from you.

Thanks for reply pls find attached file2017-04-07 - ZM email sent to (58.1 KB)
other then i found there are issues with reading emails with attachments, like some time in text it replaces character/Words as well, pls find that scenario in this (188.8 KB), you will see it adds, Page-1- etc looks its replacing p with page-1, like April will be replaced with Apage-1-pril, same with priority & help as well.


Thanks for providing the details.

We reproduced the issue of rendering email files with attachment at our end. The issue is specific to this email message as the attachment file does not contain the extension in its name. We have added a workaround for this in ASP.NET_MVC_Front_End and updated the ViewerController.cs accordingly. Please download the updated source code from the GitHub repository.

GroupDocs.Viewer is rendering your provided file without any issue, however, the issue occurs when the rendered HTML pages are displayed in the front end application. Therefore, we have logged it in our GitHub issues as We shall look into it and in case of any updates, we’ll inform you.

We would also recommend you to try our Modern UI application that is more simple, efficient and, user-friendly.

Thanks @usman.aziz for help & support, (38.6 KB)
there is another issue with IE particularly font is huge, i am attaching email as well


Thanks for coming back. We have successfully reproduced your reported issue at our end. The back end GroupDocs.Viewer API is rendering the file perfectly (see this), however, the issue occurs when the rendered HTML files are displayed in the front end application. This issue is logged in GitHub issues as As soon as we have any updates, we’ll keep you informed.

Thanks usman here is another email where email body is not displayed in proper format as well, attached is file to reproduce that as well,


Thanks for your response. Unfortunately, I could not find the problematic file in your reply. Would you please resend it?

Sorry that attachemnet is 13 MB in size after uploading it disappears from attachment as well, i am sending you screen shot though Example of the Cumbria Email.png (125.1 KB) while in outlook UI is like thisScreen Shot 12-06-17 at 08.10 PM.PNG (184.8 KB)