WebDAV extremely slow on Linux using davfs2 mount

I’m having a problem that Nextcloud is super slow when mounted on Linux using davfs2, but is decently fast on Windows (using default Windows WebDAV mounting). More precisely, directory listing is slow, i.e. ls /mnt/nexctloud takes around 15 seconds, although there are only around 10 entries (dirs and files) in my Nextcloud’s root directory.

I did some debugging (watched the server logs) and found that on Windows, only one PROPFIND request is made for the root directory, while on Linux, another PROPFIND request is made for every single sub-folder (at depth 1) as well.

On Windows:

2001:16b8:xxxx:xxxx:xxxx:d970:1e38:9636 - - [16/Sep/2021:22:41:09 +0200] "PROPFIND /remote.php/dav/files/admin/A HTTP/2.0" 207 593
2001:16b8:xxxx:xxxx:xxxx:d970:1e38:9636 - - [16/Sep/2021:22:41:09 +0200] "PROPFIND /remote.php/dav/files/admin/A HTTP/2.0" 207 19171

On Linux:

2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:51 +0200] "PROPFIND /remote.php/dav/files/admin/A/ HTTP/1.1" 207 17693
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:52 +0200] "PROPFIND /remote.php/dav/files/admin/A/B/ HTTP/1.1" 207 50925
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:53 +0200] "PROPFIND /remote.php/dav/files/admin/A/C/ HTTP/1.1" 207 3611
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:54 +0200] "PROPFIND /remote.php/dav/files/admin/A/D/ HTTP/1.1" 207 4143
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:55 +0200] "PROPFIND /remote.php/dav/files/admin/A/E/ HTTP/1.1" 207 4143
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:56 +0200] "PROPFIND /remote.php/dav/files/admin/A/F/ HTTP/1.1" 207 4143
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:57 +0200] "PROPFIND /remote.php/dav/files/admin/A/G/ HTTP/1.1" 207 5257
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:57 +0200] "PROPFIND /remote.php/dav/files/admin/A/H/ HTTP/1.1" 207 12155
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:58 +0200] "PROPFIND /remote.php/dav/files/admin/A/I/ HTTP/1.1" 207 4664
2001:16b8:xxxx:xxxx:xxxx:c7cb:361d:92d9 - - [16/Sep/2021:22:38:59 +0200] "PROPFIND /remote.php/dav/files/admin/A/J/ HTTP/1.1" 207 5998

Can I somehow get davfs2 to behave like Windows’ WebDAV driver?

perhaps it is pre-fetching results so further navigation will be faster?

Checkout the options of davfs2: https://manpages.ubuntu.com/manpages/focal/en/man5/davfs2.conf.5.html

Yes, that is my assumption as well. However, how can I prevent it from doing so? The gui_optimize Option seemed promising, but neither turning it on nor explicitly turning it off helps.

That was my guess. Further than that, you can run the thing in debug mode. But I’d check their bugtracker if there are reports for that and possible workarounds. Perhaps it’s even the OS that is requesting the structure of subfolders already…