Document history refresh expired cache

Hello. We have app with integrate Onlyoffice document service in our app. We implement document history-api for and got some troubles.

We wanna store N-versions, with no expire by time. But history cache have expire. What we can do?

my html

<!DOCTYPE html>
<html style="height: 100%;">
<head>
    <title>ONLYOFFICE Api Documentation</title>
</head>
<body style="height: 100%; margin: 0;">
<div id="placeholder" style="height: 100%"></div>
<script type="text/javascript" src="http://0.0.0.0:8880/web-apps/apps/api/documents/api.js"></script>

<script type="text/javascript">
    // config = null
    // token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhMWRiNDhhMWQyNjQ0MTcxYWQxNzAzNGE2ZDNhMmQyNSIsInRva2VuIjoiYWNjZXNzIiwiZXhwIjoxNzIyODc2ODAwLCJqdGkiOiJkMGU3NDhkZDliM2I0YWViOTU3YjMxYWMyZTRhMTE1ZCJ9.aiw1BMAruLLEjM8031TYggO3hGf4F3PtIbsw7IAfAUw"
    // fetch("http://192.168.100.75:8088/api/v1/onlyoffice/config?fileSid=9f5ef0c6-236a-40f5-a776-b3166207559c&type_download=access", {
    //     method: "GET",
    //     headers: {
    //         "authorization": `Bearer ${token}`
    //     },
    //
    // }).then(resp => resp.json()).then(conf => {
    //     config = conf

    conf = {
        "history": [
            {
                "key": "eb378244d00c48e4848434ff09f4daa4",
                "url": "http://0.0.0.0:9020/objects-versions/9f5ef0c6236a40f5a776b3166207559c/eb378244d00c48e4848434ff09f4daa4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240805T081220Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=89d87b97f06e635667663bc7f2795136163c106b0d8e49770fd854116fbc4c3a",
                "user": {
                    "id": "a1db48a1d2644171ad17034a6d3a2d25",
                    "name": "test"
                },
                "version": 1,
                "changes": [
                    {
                        "created": "2024-08-05T06:10:53",
                        "user": {
                            "id": "a1db48a1d2644171ad17034a6d3a2d25",
                            "name": "test"
                        }
                    }
                ],
                "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrZXkiOiJlYjM3ODI0NGQwMGM0OGU0ODQ4NDM0ZmYwOWY0ZGFhNCIsInVybCI6Imh0dHA6Ly8xOTIuMTY4LjEwMC4xNDA6OTAyMC90ZWFtY2xpY2stb2JqZWN0cy12ZXJzaW9ucy85ZjVlZjBjNjIzNmE0MGY1YTc3NmIzMTY2MjA3NTU5Yy9lYjM3ODI0NGQwMGM0OGU0ODQ4NDM0ZmYwOWY0ZGFhND9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPW1pbmlvJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDA4MTIyMFomWC1BbXotRXhwaXJlcz0zNjAwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZYLUFtei1TaWduYXR1cmU9ODlkODdiOTdmMDZlNjM1NjY3NjYzYmM3ZjI3OTUxMzYxNjNjMTA2YjBkOGU0OTc3MGZkODU0MTE2ZmJjNGMzYSIsInVzZXIiOnsiaWQiOiJhMWRiNDhhMWQyNjQ0MTcxYWQxNzAzNGE2ZDNhMmQyNSIsIm5hbWUiOiJcdTA0MTRcdTA0MzZcdTA0MzVcdTA0NDRcdTA0NDQgXHUwNDI1XHUwNDMwXHUwNDQwXHUwNDM0XHUwNDM4In0sInZlcnNpb24iOjEsImNoYW5nZXMiOlt7ImNyZWF0ZWQiOiIyMDI0LTA4LTA1VDA2OjEwOjUzIiwidXNlciI6eyJpZCI6ImExZGI0OGExZDI2NDQxNzFhZDE3MDM0YTZkM2EyZDI1IiwibmFtZSI6Ilx1MDQyNVx1MDQzMFx1MDQ0MFx1MDQzNFx1MDQzOCBcdTA0MTRcdTA0MzZcdTA0MzVcdTA0NDRcdTA0NDQifX1dfQ.hhsQDebY98SvBZQdhxSgYBj_xpY5mqxb8uvKoVQMZRE"
            },
            {
                "key": "43cf018046ee4f95ba273c09534dfa89",
                "url": "http://0.0.0.0:9020/objects-versions/9f5ef0c6236a40f5a776b3166207559c/43cf018046ee4f95ba273c09534dfa89?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240805T081220Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=2f1556636b057bfe3ca66a798e91ed96e44293e242ffd2ea60323e6d7cb29d69",
                "user": {
                    "id": "a1db48a1d2644171ad17034a6d3a2d25",
                    "name": "test"
                },
                "version": 2,
                "changes": [
                    {
                        "created": "2024-08-05T06:12:09",
                        "user": {
                            "id": "a1db48a1d2644171ad17034a6d3a2d25",
                            "name": "test"
                        }
                    }
                ],
                "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrZXkiOiI0M2NmMDE4MDQ2ZWU0Zjk1YmEyNzNjMDk1MzRkZmE4OSIsInVybCI6Imh0dHA6Ly8xOTIuMTY4LjEwMC4xNDA6OTAyMC90ZWFtY2xpY2stb2JqZWN0cy12ZXJzaW9ucy85ZjVlZjBjNjIzNmE0MGY1YTc3NmIzMTY2MjA3NTU5Yy80M2NmMDE4MDQ2ZWU0Zjk1YmEyNzNjMDk1MzRkZmE4OT9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPW1pbmlvJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDA4MTIyMFomWC1BbXotRXhwaXJlcz0zNjAwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZYLUFtei1TaWduYXR1cmU9MmYxNTU2NjM2YjA1N2JmZTNjYTY2YTc5OGU5MWVkOTZlNDQyOTNlMjQyZmZkMmVhNjAzMjNlNmQ3Y2IyOWQ2OSIsInVzZXIiOnsiaWQiOiJhMWRiNDhhMWQyNjQ0MTcxYWQxNzAzNGE2ZDNhMmQyNSIsIm5hbWUiOiJcdTA0MTRcdTA0MzZcdTA0MzVcdTA0NDRcdTA0NDQgXHUwNDI1XHUwNDMwXHUwNDQwXHUwNDM0XHUwNDM4In0sInZlcnNpb24iOjIsImNoYW5nZXMiOlt7ImNyZWF0ZWQiOiIyMDI0LTA4LTA1VDA2OjEyOjA5IiwidXNlciI6eyJpZCI6ImExZGI0OGExZDI2NDQxNzFhZDE3MDM0YTZkM2EyZDI1IiwibmFtZSI6Ilx1MDQyNVx1MDQzMFx1MDQ0MFx1MDQzNFx1MDQzOCBcdTA0MTRcdTA0MzZcdTA0MzVcdTA0NDRcdTA0NDQifX1dfQ.qIB0vuyRjO-HZEFyo3vQfT-eet3nosECyFeE5RRUa9k"
            },
            {
                "key": "ab35dfdabc384b588c6fd8ae9655dbf5",
                "url": "http://0.0.0.0:9020/objects-versions/9f5ef0c6236a40f5a776b3166207559c/ab35dfdabc384b588c6fd8ae9655dbf5?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240805T081220Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=41e1d26e6e2ae21bed6bbd85f8a26a0a9232ad3498d8270f281e444c544e0ffa",
                "user": {
                    "id": "a1db48a1d2644171ad17034a6d3a2d25",
                    "name": "test"
                },
                "version": 3,
                "changes": [
                    {
                        "created": "2024-08-05T06:12:51",
                        "user": {
                            "id": "a1db48a1d2644171ad17034a6d3a2d25",
                            "name": "test"
                        }
                    }
                ],
                "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrZXkiOiJhYjM1ZGZkYWJjMzg0YjU4OGM2ZmQ4YWU5NjU1ZGJmNSIsInVybCI6Imh0dHA6Ly8xOTIuMTY4LjEwMC4xNDA6OTAyMC90ZWFtY2xpY2stb2JqZWN0cy12ZXJzaW9ucy85ZjVlZjBjNjIzNmE0MGY1YTc3NmIzMTY2MjA3NTU5Yy9hYjM1ZGZkYWJjMzg0YjU4OGM2ZmQ4YWU5NjU1ZGJmNT9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPW1pbmlvJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDA4MTIyMFomWC1BbXotRXhwaXJlcz0zNjAwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZYLUFtei1TaWduYXR1cmU9NDFlMWQyNmU2ZTJhZTIxYmVkNmJiZDg1ZjhhMjZhMGE5MjMyYWQzNDk4ZDgyNzBmMjgxZTQ0NGM1NDRlMGZmYSIsInVzZXIiOnsiaWQiOiJhMWRiNDhhMWQyNjQ0MTcxYWQxNzAzNGE2ZDNhMmQyNSIsIm5hbWUiOiJcdTA0MTRcdTA0MzZcdTA0MzVcdTA0NDRcdTA0NDQgXHUwNDI1XHUwNDMwXHUwNDQwXHUwNDM0XHUwNDM4In0sInZlcnNpb24iOjMsImNoYW5nZXMiOlt7ImNyZWF0ZWQiOiIyMDI0LTA4LTA1VDA2OjEyOjUxIiwidXNlciI6eyJpZCI6ImExZGI0OGExZDI2NDQxNzFhZDE3MDM0YTZkM2EyZDI1IiwibmFtZSI6Ilx1MDQyNVx1MDQzMFx1MDQ0MFx1MDQzNFx1MDQzOCBcdTA0MTRcdTA0MzZcdTA0MzVcdTA0NDRcdTA0NDQifX1dfQ.xtXk7dvMI11gUtPdagH1BAPgpT_9AoUUKgbBsgjxL34"
            },
            {
                "key": "9e5032d3b00247aeb9eab99e1c456a72",
                "url": "http://0.0.0.0:9020/objects/a1db48a1d2644171ad17034a6d3a2d25/9f5ef0c6236a40f5a776b3166207559c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240805T081220Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=f52531eb17c5785c6e2078094e5680eeb0e11c5ca02a0a528946a2abb9622114",
                "user": {
                    "id": "a1db48a1d2644171ad17034a6d3a2d25",
                    "name": "test"
                },
                "version": 0,
                "changes": [
                    {
                        "created": "2024-08-05T06:10:27.388655Z",
                        "user": {
                            "id": "a1db48a1d2644171ad17034a6d3a2d25",
                            "name": "test"
                        }
                    }
                ],
                "token": null
            }
        ],
        "config": {
            "document": {
                "fileType": "doc",
                "key": "9e5032d3b00247aeb9eab99e1c456a72",
                "title": "test_cache.doc",
                "url": "http://0.0.0.0:9020/objects/a1db48a1d2644171ad17034a6d3a2d25/9f5ef0c6236a40f5a776b3166207559c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240805T081219Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=62e9ef334304c31bbd6c86aada45a99facf2b069d0fbcc3c08a097d944c2d6c1"
            },
            "documentType": "word",
            "editorConfig": {
                "user": {
                    "id": "a1db48a1d2644171ad17034a6d3a2d25",
                    "name": "test"
                },
                "callbackUrl": "http://0.0.0.0:8088/api/v1/onlyoffice/callback?folder=a1db48a1d2644171ad17034a6d3a2d25&obj=9f5ef0c6236a40f5a776b3166207559c",
                "mode": "edit",
                "lang": "ru",
                "coEditing": {
                    "mode": "fast",
                    "change": false
                },
                "customization": {
                    "autosave": false,
                    "forcesave": true,
                    "anonymous": {
                        "request": false,
                        "label": "Label"
                    },
                    "comments": true,
                    "compactHeader": false,
                    "compactToolbar": false,
                    "compatibleFeatures": false,
                    "help": true,
                    "hideRightMenu": true,
                    "hideRulers": false,
                    "integrationMode": "embed",
                    "macros": true,
                    "macrosMode": "Warn",
                    "mentionShare": true,
                    "mobileForceView": true,
                    "plugins": true,
                    "toolbarHideFileName": false,
                    "toolbarNoTabs": false,
                    "uiTheme": "theme-light",
                    "unit": "cm",
                    "zoom": 100
                }
            },
            "token": "token_.eyJkb2N1bWVudCI6eyJmaWxlVHlwZSI6ImRvYyIsImtleSI6IjllNTAzMmQzYjAwMjQ3YWViOWVhYjk5ZTFjNDU2YTcyIiwidGl0bGUiOiJ0ZXN0X2NhY2hlLmRvYyIsInVybCI6Imh0dHA6Ly8xOTIuMTY4LjEwMC4xNDA6OTAyMC9vYmplY3RzL2ExZGI0OGExZDI2NDQxNzFhZDE3MDM0YTZkM2EyZDI1LzlmNWVmMGM2MjM2YTQwZjVhNzc2YjMxNjYyMDc1NTljP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9bWluaW8lMkYyMDI0MDgwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDVUMDgxMjE5WiZYLUFtei1FeHBpcmVzPTg2NDAwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZYLUFtei1TaWduYXR1cmU9NjJlOWVmMzM0MzA0YzMxYmJkNmM4NmFhZGE0NWE5OWZhY2YyYjA2OWQwZmJjYzNjMDhhMDk3ZDk0NGMyZDZjMSJ9LCJkb2N1bWVudFR5cGUiOiJ3b3JkIiwiZWRpdG9yQ29uZmlnIjp7InVzZXIiOnsiaWQiOiJhMWRiNDhhMWQyNjQ0MTcxYWQxNzAzNGE2ZDNhMmQyNSIsIm5hbWUiOiJcdTA0MjVcdTA0MzBcdTA0NDBcdTA0MzRcdTA0MzggXHUwNDE0XHUwNDM2XHUwNDM1XHUwNDQ0XHUwNDQ0In0sImNhbGxiYWNrVXJsIjoiaHR0cDovLzE5Mi4xNjguMTAwLjc1OjgwODgvYXBpL3YxL29ubHlvZmZpY2UvY2FsbGJhY2s_Zm9sZGVyPWExZGI0OGExZDI2NDQxNzFhZDE3MDM0YTZkM2EyZDI1Jm9iaj05ZjVlZjBjNjIzNmE0MGY1YTc3NmIzMTY2MjA3NTU5YyIsIm1vZGUiOiJlZGl0IiwibGFuZyI6InJ1IiwiY29FZGl0aW5nIjp7Im1vZGUiOiJmYXN0IiwiY2hhbmdlIjpmYWxzZX0sImN1c3RvbWl6YXRpb24iOnsiYXV0b3NhdmUiOmZhbHNlLCJmb3JjZXNhdmUiOnRydWUsImFub255bW91cyI6eyJyZXF1ZXN0IjpmYWxzZSwibGFiZWwiOiJUZWFtQ2xpY2sifSwiY29tbWVudHMiOnRydWUsImNvbXBhY3RIZWFkZXIiOmZhbHNlLCJjb21wYWN0VG9vbGJhciI6ZmFsc2UsImNvbXBhdGlibGVGZWF0dXJlcyI6ZmFsc2UsImhlbHAiOnRydWUsImhpZGVSaWdodE1lbnUiOnRydWUsImhpZGVSdWxlcnMiOmZhbHNlLCJpbnRlZ3JhdGlvbk1vZGUiOiJlbWJlZCIsIm1hY3JvcyI6dHJ1ZSwibWFjcm9zTW9kZSI6Ildhcm4iLCJtZW50aW9uU2hhcmUiOnRydWUsIm1vYmlsZUZvcmNlVmlldyI6dHJ1ZSwicGx1Z2lucyI6dHJ1ZSwidG9vbGJhckhpZGVGaWxlTmFtZSI6ZmFsc2UsInRvb2xiYXJOb1RhYnMiOmZhbHNlLCJ1aVRoZW1lIjoidGhlbWUtbGlnaHQiLCJ1bml0IjoiY20iLCJ6b29tIjoxMDB9fX0.qoGMsbSg2FTrsqMkF8EjGubemKI3nLPOPzybjey_1ec"
        }
    }

    var onRequestHistory = function () {
        docEditor.refreshHistory({
            "history": conf.history
        });
    };


    var onRequestHistoryData = function (event) {
        var version = event.data;
        console.log(conf.history.filter(data => data.version == version))
        docEditor.setHistoryData({
            ...conf.history.filter(data => data.version == version),
        })
    };

    window.docEditor = new DocsAPI.DocEditor("placeholder", {
        "events": {
            "onRequestHistoryData": onRequestHistoryData,
            "onRequestHistory": onRequestHistory,
        },
        ...conf.config,
    })
    // })

</script>
</body>
</html>

Hey @n.zykov :wave:

Please note, that ONLYOFFICE Docs includes the document editor , document editing service , document command service , document conversion service and document builder service .
The document manager and document storage service are either included to ONLYOFFICE Workspace or must be implemented by the software integrators which use ONLYOFFICE Docs on their own server.

It’s important to understand that the document server itself does not store documents. For a detailed explanation of how the document server operates and to review the version history, please refer to the following links:

Additionally, the document server includes specific parameters for managing the deletion of cached documents:

  • services.CoAuthoring.expire.documentsCron
  • services.CoAuthoring.expire.files
  • services.CoAuthoring.expire.filesCron

For further details on configuring these settings, please visit this link.

I have studied the links you provided.

I understand that your solution does not store files. But it caches them for 24 hours (by default).
My question is - How do I update the contents of a file in the cache by key?

  • Is it enough to simply save files and transfer download links to the body of docEditor.setHistory Data?

  • Is it possible to save the version delta?

Hey @n.zykov :vulcan_salute:

Thank you for reaching out and for reviewing the provided information.

To assist you better, could you please clarify your specific goal? Understanding your end objective will help us provide more accurate guidance.

Please note that version management is typically handled by the document storage service.
Could you explain why you need to update or re-save a cached version of the document on the document server?