Android App not Caching Javascript (.js) files

Support intro

The files
/dist/core-common.js?v=dbf4c7ea-9 15 MB and
/apps/text/js/vendors.js?v=a0d58a74aeda089f9fcf 7 MB
are loaded mostly any time again to the Android App.


I have two instances of Nextcloud 27.1.5.1. I want to edit small markdown files .md to take short notices on my way, say on the train or in the wildness. So there is no good connection.

In one instance everything works fine. The other instance (on another server in another network), called from the same Android App, delays multiple seconds. Looking into the apache log, I see two files, beeing loaded (not every time) but mostly, again and again. This behaviour istnt like in the good running instance.
The files are:
/dist/core-common.js?v=dbf4c7ea-9 15 MB and
/apps/text/js/vendors.js?v=a0d58a74aeda089f9fcf 7 MB
Sometimes these files are loaded in the good working instance too, but they seem to be smaller there. In the filesystem they are as big as described above.

I think, it could not be the right way, too load this files again and again for editing files of 100 bytes ???
I dont know, if the fine working instance, does a better caching, or perhaps it connects directy to the wopi server ?

I have buyed a third raspi, just to clone the running instance and move it step for step to the not working instance …

I struggeled on this theme for about a week, so any help is appreciated.

Nextcloud version (eg, 20.0.5): 27.1.5.1
Nextcloud App Text Version (eg, 20.0.5): 3.8.0
Nextcloud App CODE-Server Version (eg, 20.0.5): 23.5.602
Android App Version_: ‘3.26.0’
Operating system and version (eg, Ubuntu 20.04): Opensuse leap 15.5 on RasPi 4b arm64
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.51
PHP version (eg, 7.4): php8-fpm 8.2.13

The issue you are facing:
The files
/dist/core-common.js?v=dbf4c7ea-9 15 MB and
/apps/text/js/vendors.js?v=a0d58a74aeda089f9fcf 7 MB
are loaded mostly any time again to the Android App.

I have two instances of Nextcloud 27.1.5.1. I want to edit small markdown files .md to take short notices on my way, say on the train or in the wildness. So there is no good connection.

In one instance everything works fine. The other instance (on another server in another network), called from the same Android App, delays multiple seconds. Looking into the apache log, I see two files, beeing loaded (not every time) but mostly, again and again. This behaviour istnt like in the good running instance.
The files are:
/dist/core-common.js?v=dbf4c7ea-9 15 MB and
/apps/text/js/vendors.js?v=a0d58a74aeda089f9fcf 7 MB
Sometimes these files are loaded in the good working instance too, but they seem to be smaller there. In the filesystem they are as big as described above.

I think, it could not be the right way, too load this files again and again for editing files of 100 bytes ???
I dont know, if the fine working instance, does a better caching, or perhaps it connects directy to the wopi server ?

I have buyed a third raspi, just to clone the running instance and move it step for step to the not working instance …

I struggeled on this theme for about a week, so any help is appreciated.

Is this the first time you’ve seen this error? (Y/N):
Yes but its reproducable

Steps to replicate it:

  1. Create account on Android App
  2. Create an reopen an .md file, perhaps a folder sescription file.
  3. Sometimes move to another folder, open an image and reopen the .md file

The output of your Nextcloud log in Admin > Logging:

{"reqId":"MJnhsbhee8RqSGZMeEM8","level":1,"time":"2023-12-18T07:40:31+00:00","remoteAddr":"192.168.10.123","user":"--","app":"text","method":"GET","url":"/index.php/apps/files/directEditing/SjNWeKASoWfB6X7mes7W9inoTMeHPb3fG5bMRoXxbt7QfnoJJ99FBYqtqiPF4xcj","message":"Keep previous document of 1610","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.26.0","version":"27.1.5.1","data":{"app":"text"}}
{"reqId":"PmGv1qEcKLJLhtqSqnVL","level":1,"time":"2023-12-18T07:40:55+00:00","remoteAddr":"192.168.10.104","user":"safe","app":"text","method":"PUT","url":"/index.php/apps/text/session/create","message":"Keep previous document of 1610","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0","version":"27.1.5.1","data":{"app":"text"}}
{"reqId":"U4JZwykUpiZvLEDhBvN5","level":1,"time":"2023-12-18T07:41:28+00:00","remoteAddr":"192.168.10.104","user":"safe","app":"text","method":"PUT","url":"/index.php/apps/text/session/create","message":"Keep previous document of 1610","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0","version":"27.1.5.1","data":{"app":"text"}}
{"reqId":"y572tESySW0J8a4UbPAE","level":1,"time":"2023-12-18T07:41:47+00:00","remoteAddr":"192.168.10.123","user":"--","app":"text","method":"GET","url":"/index.php/apps/files/directEditing/r3jXjo9XRH9kbyo75P5GTZATjXLxtMwXswryRsQBzFrWdH6iJz9NRxpDPfMMTP6F","message":"Keep previous document of 1610","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.26.0","version":"27.1.5.1","data":{"app":"text"}}
{"reqId":"JB8uAiic1ocIaxdB8UyT","level":1,"time":"2023-12-18T07:42:18+00:00","remoteAddr":"192.168.10.104","user":"safe","app":"text","method":"PUT","url":"/index.php/apps/text/session/create","message":"Keep previous document of 1610","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0","version":"27.1.5.1","data":{"app":"text"}}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ccccccccccccccccccccc',
  'passwordsalt' => 'yyyyyyyyyyyyyyyyyyy',
  'secret' => 'eeeeeeeeeeeeeeeeeeeeee',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'opcache.save_comments' => 1,
  'trusted_domains' =>
  array (
    0 => 'domainname',
    1 => '192.168.7.172',
    2 => '192.168.13.213',
  ),
  'datadirectory' => '/srv/www/htdocs/domainname/data',
  'dbtype' => 'mysql',
  'version' => '27.1.5.1',
  'overwrite.cli.url' => 'https://domainname',
  'dbname' => 'domainname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'yyyy',
  'proxy' => '192.168.7.172:3128',
  'proxyexclude' =>
  array (
    0 => '127.0.0.1',
    1 => 'localhost',
    2 => 'domainname',
  ),
  'installed' => true,
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\MarkDown',
    2 => 'OC\\Preview\\OpenDocument',
    3 => 'OC\\Preview\\PDF',
    4 => 'OC\\Preview\\MSOffice2003',
    5 => 'OC\\Preview\\MSOfficeDoc',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\Image',
    8 => 'OC\\Preview\\Photoshop',
    9 => 'OC\\Preview\\TIFF',
    10 => 'OC\\Preview\\SVG',
    11 => 'OC\\Preview\\Font',
    12 => 'OC\\Preview\\MP3',
    13 => 'OC\\Preview\\Movie',
    14 => 'OC\\Preview\\MKV',
    15 => 'OC\\Preview\\MP4',
    16 => 'OC\\Preview\\AVI',
  ),
  'mail_from_address' => 'safe',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'domainname',
  'mail_smtphost' => '192.168.7.207',
  'mail_smtpport' => '25',
  'default_phone_region' => 'DE',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 1,  //same behaviour on other loglevels
  'updater.secret' => 'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn',
);


The output of your Apache/nginx/system log in /var/log/____:

192.168.10.123 - - [18/Dec/2023:08:41:42 +0100] "GET /ocs/v2.php/cloud/capabilities?format=json HTTP/1.1" 304 -
192.168.10.123 - - [18/Dec/2023:08:41:42 +0100] "GET /ocs/v2.php/apps/user_status/api/v1/predefined_statuses?format=json HTTP/2.0" 404 228
192.168.10.123 - - [18/Dec/2023:08:41:42 +0100] "GET /ocs/v2.php/cloud/user?format=json HTTP/2.0" 200 499
192.168.10.123 - - [18/Dec/2023:08:41:43 +0100] "PROPFIND /remote.php/dav/files/safe/ HTTP/1.1" 207 1207
192.168.10.123 - - [18/Dec/2023:08:41:43 +0100] "GET /ocs/v2.php/apps/files_sharing/api/v1/shares?path=%2F&reshares=true&subfiles=true HTTP/1.1" 200 138
192.168.10.123 - - [18/Dec/2023:08:41:46 +0100] "POST /ocs/v2.php/apps/files/api/v1/directEditing/open?format=json HTTP/1.1" 200 212
192.168.10.123 - - [18/Dec/2023:08:41:46 +0100] "GET /ocs/v2.php/cloud/user?format=json HTTP/2.0" 200 499
192.168.10.123 - - [18/Dec/2023:08:41:47 +0100] "GET /index.php/apps/files/directEditing/r3jXjo9XRH9kbyo75P5GTZATjXLxtMwXswryRsQBzFrWdH6iJz9NRxpDPfMMTP6F HTTP/2.0" 200 5282
192.168.10.123 - - [18/Dec/2023:08:41:47 +0100] "GET /index.php/core/js/oc.js?v=dbf4c7ea HTTP/2.0" 200 3359
192.168.10.123 - - [18/Dec/2023:08:41:47 +0100] "GET /dist/core-common.js?v=dbf4c7ea-9 HTTP/2.0" 200 15811685
192.168.10.123 - - [18/Dec/2023:08:41:51 +0100] "GET /apps/text/js/vendors.js?v=a0d58a74aeda089f9fcf HTTP/2.0" 200 7918487
192.168.10.123 - - [18/Dec/2023:08:41:53 +0100] "POST /index.php/apps/text/attachments HTTP/2.0" 200 22
192.168.10.123 - - [18/Dec/2023:08:41:53 +0100] "POST /index.php/apps/text/session/sync HTTP/2.0" 200 675
192.168.10.123 - - [18/Dec/2023:08:41:53 +0100] "POST /index.php/apps/text/session/push HTTP/2.0" 200 46
192.1

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{“reqId”:“MJnhsbhee8RqSGZMeEM8”,“level”:1,“time”:“2023-12-18T07:40:31+00:00”,“remoteAddr”:“192.168.10.123”,“user”:“–”,“app”:“text”,“method”:“GET”,“url”:“/index.php/apps/files/directEditing/SjNWeKASoWfB6X7mes7W9inoTMeHPb3fG5bMRoXxbt7QfnoJJ99FBYqtqiPF4xcj”,“message”:“Keep previous document of 1610”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.26.0”,“version”:“27.1.5.1”,“data”:{“app”:“text”}}
{“reqId”:“PmGv1qEcKLJLhtqSqnVL”,“level”:1,“time”:“2023-12-18T07:40:55+00:00”,“remoteAddr”:“192.168.10.104”,“user”:“safe”,“app”:“text”,“method”:“PUT”,“url”:“/index.php/apps/text/session/create”,“message”:“Keep previous document of 1610”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0”,“version”:“27.1.5.1”,“data”:{“app”:“text”}}
{“reqId”:“U4JZwykUpiZvLEDhBvN5”,“level”:1,“time”:“2023-12-18T07:41:28+00:00”,“remoteAddr”:“192.168.10.104”,“user”:“safe”,“app”:“text”,“method”:“PUT”,“url”:“/index.php/apps/text/session/create”,“message”:“Keep previous document of 1610”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0”,“version”:“27.1.5.1”,“data”:{“app”:“text”}}
{“reqId”:“y572tESySW0J8a4UbPAE”,“level”:1,“time”:“2023-12-18T07:41:47+00:00”,“remoteAddr”:“192.168.10.123”,“user”:“–”,“app”:“text”,“method”:“GET”,“url”:“/index.php/apps/files/directEditing/r3jXjo9XRH9kbyo75P5GTZATjXLxtMwXswryRsQBzFrWdH6iJz9NRxpDPfMMTP6F”,“message”:“Keep previous document of 1610”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.26.0”,“version”:“27.1.5.1”,“data”:{“app”:“text”}}
{“reqId”:“JB8uAiic1ocIaxdB8UyT”,“level”:1,“time”:“2023-12-18T07:42:18+00:00”,“remoteAddr”:“192.168.10.104”,“user”:“safe”,“app”:“text”,“method”:“PUT”,“url”:“/index.php/apps/text/session/create”,“message”:“Keep previous document of 1610”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0”,“version”:“27.1.5.1”,“data”:{“app”:“text”}}

  • Are there any differences in terms of the front-end? What are the reverse proxies and HTTPS termination approaches for these two deployments?
  • Without getting into the details since it’s just a hunch w/o evidence, which server is associated with the first account profile in your Android client versus your second account profile?
  • It might be informative to install a Dev instance of the Android client and connect it to the slower one to see if anything changes (the Dev edition of the client can be installed alongside the Stable edition since they use different local storage folders - as long as you don’t configure auto-upload in the Dev edition or at least make sure any auto-upload folders don’t overlap with your parallel installed Stable edition). You can grab a ready-to-go built Dev edition of the app via F-Droid - that’s usually the easiest approach).

There was a relatively recent report of this behavior[1], but it hasn’t been fully debugged. It’s possible there may be something useful there or you may have something useful to contribute to the discussion.

Also, I would have expected the behavior to be universal. So your two environments either:

  • have something else going on than what’s in that linked Issue or…
  • may hold the key to getting to the bottom of things :slight_smile:

[1] Enable WebView caching · Issue #11800 · nextcloud/android · GitHub

I have upgraded to NC28 and the delay is gone. I saw that an internal app ‘richdocument’ was updated, and i think that was part of the problem. Now the two files will not be loaded anymore. In the apache logs i saw, it was loaded once with only 4MB instead of 15 MB, so it might be the reason, now it will be cached?
But obviously it was not a problem of the environment, but of (an app of) nextcloud …
Thanks for your hints either.

I have another instance on the same machine with NC27.1.1 which still serves that files, but im not able to debug on android, sorry

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.