I have a question. When using the onlyoffice-de 8.2.3 version, after modifying a file that has already been saved on the server (by replacing the source file directly with Java), the file is still read from the cached history file after refreshing and loading in the onlyoffice component, rather than the latest file. How can I solve this issue so that the latest file can be loaded immediately after refreshing?
Hi @hunter_juan
Could you briefly describe how you replace the file using Java? The issue is likely related to this process.
Renamed the new file using the file name of the original file
Hi,
From your description, it seems like the editor is loading an older, cached version of the file—even after you’ve replaced it directly on the server via Java.
This behavior is expected if the document.key
value in your config
hasn’t changed. ONLYOFFICE uses this key
as a cache identifier: if the same key
is provided, the editor assumes nothing has changed and loads from cache.
*Regenerate the key
each time the document changes.
According to the docs:
“Every time the document is edited and saved, the
document.key
parameter must also be generated anew … otherwise the known key is sent and the document will be taken from cache”
https://api.onlyoffice.com/docs/docs-api/usage-api/config/document/#key
- Document history workflow and cache behavior: Document history guide
- Explanation of the
document.key
and its role in caching/co‑editing: What is the document.key parameter?
++ https://api.onlyoffice.com/docs/docs-api/more-information/faq/editing