How to completely avoid file system cache


#1

Hello,


I am using GroupDocs.Viewer Java library v3.0.0. I want to completely avoid caching on local file system.
I went through official example from github and found interesting things.
1. storagePath is always mandatory in ViewerConfig
2. When I set viewerConfig.setUseCache(true), GroupDocs still create the structure for cached files and store some xml.
3. Also most of styles are not been applied when useCache is false. Tables, images, and other visual elements look very bad.
4. I tried to implement own cache handler (using ICacheDataHandler interface), but without any success. I see still local disk usages. And calls are made for original file only.

I am aware of this example but it’s for old version and still uses local disk.
Could you please provide recommendation on this?
I have to use S3 as cache storage and nothing on local file system.

Thanks,
Andriy

#2

Hello Andriy,


Thanks for showing your interest GroupDocs.Viewer for Java 3.x.

I am going to write inline response against your points

1. storagePath is always mandatory in ViewerConfig
Yes storage location is mandatory part of ViewerConfig.


2. When I set viewerConfig.setUseCache(true), GroupDocs still create the structure for cached files and store some xml.
Yes, it is correct and those things are the part of backend API operations. Please don’t consider those files as the output of the API.


3.Also most of styles are not been applied when useCache is false. Tables, images, and other visual elements look very bad.
Please let us know the browsers information. Also, please provide us the problematic file.


4. I tried to implement own cache handler (using ICacheDataHandler interface), but without any success. I see still local disk usages. And calls are made for original file only.
To use the remote based data storage, the GroupDocs.Viewer for Java 3.x provides the facility to implement a custom input data handler.
Kindly have a look at the following link.
http://www.groupdocs.com/docs/display/viewerjava/Working+With+Custom+Input+Data+Handlers

Have a nice day!



#3

Hello Muhammad ,


Thanks for your reply and explanation.
I’ve fixed item 3, there were issues with applying styles.

Regarding item 4 - you have pasted the link for Custom Input Data Handlers. My understanding is that Input Data Handlers works with source of document. I’ve already implemented my own S3 input data handler.

I was asking about Custom Cache Handler - the class which should implements ICacheDataHandler interface and should be passed as third parameter in handler, e.g.:

htmlHandler = new ViewerHtmlHandler(viewerConfig, new CustomInputDataHandler(), new CustomCacheHandler());

The idea is to store all cached files (html, css, img, etc.) on S3 storage.

EDITED: I know about this example for old versions of GroupDocs Viewer. I am looking for similar example/recommendation for version 3x.
Thanks,
Andriy

#4
Hello Andriy,

Thank you for your explaination,

As far as your following point is concerned.
I was asking about Custom Cache Handler - the class which should implements ICacheDataHandler interface and should be passed as third parameter in handler, e.g.:

htmlHandler = new ViewerHtmlHandler(viewerConfig, new CustomInputDataHandler(), new CustomCacheHandler());

Please note that the GroupDocs.Viewer for Java 3.x API is already supporting the code snippet as you mentioned in your post. However, If you have already implemented the CustomCacheHandler but it doesn't working as required. Then please send us the code snippets of your implementation.

Many thanks.

#5

Hi There,


I was asking about Custom Cache Handler - the class which should implements ICacheDataHandler interface
Please find the attached project provided by the concerned team (S3CacheHandler class implements ICacheDataHandler). We would recommend you to explore the project using GroupDocs.Viewer for Java 3.7.0 and share your feedback.

Many Thanks

#6

Hello Muhammad,


Can I look at the source code of implementation Cache Handler GroupDocs.Viewer for Java 3.x API?

I’ve attached the code that I’m trying to implement - my cache handler which should store cache files on S3 bucket.

Thanks,
Andriy

#7

Thanks, I will take a look.


#8

Hi Andiry,


Thank you for providing us your code file.

I am creating an investigation ticket in our Issue tracking system. Product team will investigate and you will be informed through this forum thread in the case of any further updates.

Many thanks.

#9

Hi Shank,


You are welcome.

Many Thanks


#10

Hello,

Any updates on this?
It blocks me to finish the integration on production and purpose the full license.

Thanks,
Andriy


#11

Hi Andriy,


Thank you for asking. Unfortunately not yet but as we get any update, we will certainly apprise you.

Thanks

#12

@andriybudzinskyy,

The issue you have found earlier (filed as VIEWERJAVA-1205) has been fixed in this update.