Speed up fetching of WebDAV folder listing
Before this patch, the WebDAV requests was done once all the scripts are
executed and that the DOMContentLoaded is executed. This is an issue
because it takes a long time for all the scripts to be run (~900ms).
Futhermore, once the request is done the CPU is idle because there is no
script anymore to fetch and it's just waiting for the response.
This patch makes the script do the WebDAV when executing the script
instead of when DOMContentLoaded is executed. This has the advantage
that during the WebDAV requests, the browser is not idle but continue
executing the other scripts (thanks to the async IO).
End result: the file listing is displayed 100ms earlier
This also makes sure that the files_sharing scripts are executed earlier
than the files scripts as they have event listeners on the files apps.
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Please register or sign in to comment