nextcloud / nextcloud/notes-android

Enable WebView caching

Open
#1,843 1 comment 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Performance 🚀
Dominant language
Java
Stars
1.1k
Forks
168
Avg merge
1d 17h
Merged PRs (30d)
31

Description

Is your feature request related to a problem? Please describe.

Whenever you open a document, the amount of data downloaded (even for empty documents) is about 15 MB. On mobile data this is absolutely too much.
--> The reason is file core-common.js is too big and the WebView wont cash it.

I already have http compression enabled but this does not help in WebView. The Cache of the WebView seems to be cleared each time directly on closing it. This triggeres a completely redownload of that js file (and of course others).

Also, this absolutely slows down the process of opening a document - from tapping on it to the content is shown. Most of the times there is "it needs long to load" at the bottom to read. (No, my server is fast enough and my internet connection is 500/100 glass fiber - this is not the problem.)

This does also happen to the Files apps, see here: https://github.com/nextcloud/android/issues/11800

Describe the solution you'd like

Enable caching of WebView or at least make it an option. The cache should not be cleared on closing the WebView and also not on closing the App. It should be saved into the App Cache (at least I read this would likely for apps with webview cashing enabled, you probably know the right solution).

Describe alternatives you've considered

Reduce the size of loaded components on https://github.com/nextcloud/server, with under core-common.js. The pull request https://github.com/nextcloud/server/pull/38329 is mostly a performance boost in general but will not degrese the amount of data downloaded. For public web pages like direct editing it should not use all of that components.
This is only a workaround in my opition.

Additional context

See the following topic. Read carefully, there are screenshots, logs and so on. Also check the issue following.
https://help.nextcloud.com/t/loading-new-page-hanging-under-certain-conditions/165873
https://github.com/nextcloud-snap/nextcloud-snap/issues/2450

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Android client's WebView setup and reviewing the reported core-common.js download behavior, along with the linked Notes, Files, server, and snap issues. Confirm how WebView cache data behaves across document and app closure; done means repeated document opens no longer redownload the large assets, or caching is exposed as a documented option.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.