Store Cache on amazon S3 & generate cache on demand


#1

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 ?


#2

@tarif,

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.


#3

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


#4

@tarif,

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.


#5

Thanks it was great help :slight_smile:


#6

@tarif,

You are always welcome.


#7

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


#8

@tarif,

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.


#9

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


#10

@tarif,

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.


#11

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


#12

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 ?


#13

@tarif,

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.


#14

Thanks for reply pls find attached file2017-04-07 - ZM email sent to School.zip (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 attachmentreplaceCharacters.zip (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.


#15

@tarif,

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 https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET/issues/176. 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.


#16

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


#17

@tarif,

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 https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET/issues/147. As soon as we have any updates, we’ll keep you informed.


#18

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,


#19

@tarif,

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


#20

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)