Skip to content

Cache folder content instead of getting it from the server every time #1611

Closed

Description

@jancborchardt

(Original issue opened by @oparoz in the old repo)

Every time we enter a folder, a request is made to apps/files/ajax/list.php in order to get data to build the view.
It can take between 100ms and 500ms to get that information (on top of the time it takes to connect) on a fast server, depending on the folder's content. Probably much more on a Raspberry.

It turns out that even a 100ms delay is noticeable when you do a A/B comparison.

I propose the following change:

  • cache the data structures which are built after receiving fresh data. It might not be possible to cache everything because of the memory it would require I guess.
  • send the folder's etag to list.php
  • the server returns an empty files array if the etag is the same as the current one
  • the client uses either the cache or the fresh data, depending on if there's been an etag change or not

Letting the Files experts decide if that's feasible and worth it
@schiessle @LukasReschke @icewind1991

Activity

  1. LukasReschke commented on Oct 3, 2016

    @LukasReschke
    Member

    I'd do it the other way around, just send a subfolder listing back as well in the top parent node. So if I'm in the folder /bar/ I also get the response back for /bar/foo and /bar/bar and an ETAG.

    Once we then enter the subfolder it's subfolders and ETAGs are requested as well.

    I'm not entirely sure how this would behave with external storages, @icewind1991. Thoughts on that?

  2. nickvergessen commented on Oct 5, 2016

    @nickvergessen
    Member

    The problem is, that a change in the share information, and favoriting/commenting does not change the etag... Therefor you would then need to do a hard refresh to see if something changed....

  3. oparoz commented on Oct 5, 2016

    @oparoz
    Member

    Well, we could still refresh the page like we do now, but just not get the list of files if we know things haven't changed. I'm not sure how it works in the back-end. I'm assuming you can do partial retrieval of data if a comment has been added per example.

  4. rullzer commented on Oct 6, 2016

    @rullzer
    Member

    We use webdav now. So we can just do etag magic. Which might be a ton of fun in javascript ...

    But as @nickvergessen points out not all info will be updated then. And we currently (besides polling) have no way to get notified about new comments or shares. Of course we could still fire off a request in the background. And rerender stuff as needed. But that to will be a major rewrite.

  5. ghost removed
    staleTicket or PR with no recent activity
    on Jun 12, 2019
  6. szaimen commented on May 21, 2021

    @szaimen
    Contributor

    I suppose this issue is still valid? If not, please close this issue!

  7. added and removed
    1. to developAccepted and waiting to be taken care of
    on Jun 22, 2023
  8. skjnldsv commented on Jun 22, 2023

    @skjnldsv
    Member

    Built-in files to vue.
    Will close as soon as all views are migrated

  9. self-assigned this
    on Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions