Cloud Computing Insider Awards 2022: Vote for ONLYOFFICE

Caching in OnlyOffice of files stored on HumHub server

Do you want to: Ask a how-to question

Document Server version: (Community)
Type of installation of the Document Server: docker
OS: Red Hat Enterprise Linux 8
Browser version: independent
HumHub plugin 2.4.0 to view and partly edit documents saved on HumHub server

Due to our integration we do update/refresh Office files on HumHub as well, not just by editing with OnlyOffice. In fact, most of the time we are interested in the preview provided by OnlyOffice.

Now that means that if file xyz is

  1. uploaded/stored in Humhub
  2. Previewed in OnlyOffice (using the plugin/module in Humhub, i.e. the OO functionalities get the file from storage on the HumHub server o be displayed)
  3. Update the same file on HumHub side (not changing the storage link!)
  4. Trying to preview in OnlyOffice again, we always see the old version; while the download, including the direct download with the storage link confirms that the file has been replaced/updated.

That is some caching on OnlyOffice side, and when I try a day or more later, the good new version is previewed.

My question is, I assume that the duration of such caching is somewhere set in default.json.
Could you tell me which parameter(s)? There seem to be so many, and I do not understand enough to know which.

Hello @classan
Could you please record a videofile while you are reproducing the issue? We would like to try to reproduce the issue scenario.
Also let us know your HumHub version.

By the way, recently we released Document server v.7.1.1. It is always better to run update timely.

1 Like

Thanks! Humhub is HumHub Professional Edition Version: 1.11.1
The special plugin with which we get the attachments copied and synched from our Document management system is called “Documenta” and was developed for us by the HumHub team directly. After some discussion we first took out the opening in OnlyOffice, as we do not want those synched documents to be edited on HumHub, but the preview is too convenient to ignore, so we allow the Viewing of the documents in OnlyOffice.

I tried a screenrecording here
The password for download is OnlyOffice2022!

Thank you for video file.
I have tried to reproduce the issue, but I can’t find “Documenta” module to install it on my test HumHub server. I tried to find it in Modules > Browse online. Could you please point me to it?

Hi there, the module is not in the marketplace, but you can find the latest code here: HumHub NC

The module calls the API of a GoFAST server (our Document management server), so unless you install that, it is not easy to see exactly what is done. But it just fetches a file from a link using that web service instead of uploading a file from the client

GoFAST is basically a very thickly wrapped Alfresco

I believe that this issue is related to the fact that you have updated file with third-party module.

So, when you are trying to open file for view, Document server uses the old document key.

Please let me explain in detail. Document server uses document key as main file identification. This parameter allows users too see and edit the same file.

The new key is generated when editing session is over (you closed browser tab with a file) or file is saved.

So, what happens in your scenario. User edited file > closed and saved the file. At this step new key was generated. After that you have updated the file via third-party module and tried to open the file again. Document server used old key because it doesn’t know that file was updated. So you see the old version of the file.

Useful links:

Unfortunately, there’s nothing what we can do on our side since it’s related to logic of Document server work.

Sorry for inconvenience.

1 Like

Oh, thanks for the explanation, that is very helpful. But I think not all is lost.
Let me see if I understand well.

I see that when viewing/editing a file from HumHub in OnlyOffice, the value of onlyoffice_key (in the file table) is set/calculated. When all editing is done, the value seems to be unset with the callback; if that does not happen, the key remains in HumHub to access the same file, and also on the OO server, until the key somehow expires on the OO server and also correspondingly on HumHub at some point, (because otherwise we would never have gotten the updated-elsewhere version displayed in Humhub, which we do get when a day or so has passed after the last view)

With the documents-updated-by-other-sources, as we do it, wouldn’t it be an option to enforce onlyoffice_key=null if the document was updated by other means?
You see, documents / attachments linked to our Document management system cannot be updated using OnlyOffice editor, only viewed, so in those cases we do not expect the key to be reused, and we could as well get rid of it

I tried this, and it worked (another screenrecording is here again with the password OnlyOffice2022!

Thank you for video file.
In general, I believe that manual actions with database is not a good way. The consequences may be unpredictable.
As for your idea, we need some to discuss internally. I will update this post when we have something to share.

1 Like

We have checked the situation and we decided to start working on your suggestion.
But I cannot provide you with exact timeframes or exact mechanism which we will implement at the moment.
When the work is finished, we will release it as a new version of connector app and I will update this post.
Thank you for your idea.

1 Like

Thank you very much for taking this into consideration!