You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
External storage keep session between calls for WebDAV and others #11815
When mounting a WebDAV / ownCloud external storage, CURL is used but the session is never kept, possibly causing additional overhead.
We should look into keeping the CURL HTTP session in the PHP session somehow.
One idea would be to store the session cookie returned by the first CURL call.
This is especially important to improve the performance for server to server sharing.
(Impl. detail: Any reason to use the cookies from the first call and not the cookies from all / last call?
Then you'd also catch cases where the cookies timeout (or similar) and you'd re-auth (HTTP 401) and get new cookies.)
From what I see there are actually two mechanisms:
FS operations: Sabre Client: I haven't looked into the details but I'd expect it to somehow keep the session, at least within the same PHP call. I believe that it also uses curl
Uploads/downloads/fopen: direct curl calls (the file is downloaded locally in a temp file to allow random access)
Maybe there's a way to consolidate these and/or to make the curl session cookie survive between PHP calls.
Wouldn't setting an Auth-Header for every call solve the problem for now?
I don't think it would have to be the full session. With the auth header the server would still have to verify the credentials (with the negative impact if for example LDAP Auth.) but it does that now as well. But with Auth-Header it would be half the requests.
FS operations: Sabre Client: I haven't looked into the details but I'd expect it to somehow keep the session, at least within the same PHP call. I believe that it also uses curl
This is where we could achieve double performance for the update phase of a sync run. (assuming that a unauthed request and an authed response take the same time and not taking into account how the file scanner might pre-cache some info)
Uploads/downloads/fopen: direct curl calls (the file is downloaded locally in a temp file to allow random access)
Two comments I got to this one:
A local download is not good since it leads to a possible timeout for the syncing client since the server does not send anything in the meanwhile to the sync client. It also doesn't efficiently use the bandwidth then. @ogoffart and @guruz have implemented a streaming solution for one customer-specific backend. Contact us if you want to know more.
The sync client also supports a special feature called directDownloadUrl (dDU webdav propery). With that, the client could directly go to the mounted instance (without going through the middleman instance). I understand that this is not possible/desired in all situations though (firewalls, abstractions, information hiding etc)
Note: streaming download might be achievable for WebDAV at least (but not all backends would support this). I believe there's a PR from someone that already provides this: #10620
Activity
guruz commentedon Oct 28, 2014
(Impl. detail: Any reason to use the cookies from the first call and not the cookies from all / last call?
Then you'd also catch cases where the cookies timeout (or similar) and you'd re-auth (HTTP 401) and get new cookies.)
PVince81 commentedon Oct 28, 2014
From what I see there are actually two mechanisms:
Maybe there's a way to consolidate these and/or to make the curl session cookie survive between PHP calls.
dragotin commentedon Oct 28, 2014
Wouldn't setting an Auth-Header for every call solve the problem for now?
I don't think it would have to be the full session. With the auth header the server would still have to verify the credentials (with the negative impact if for example LDAP Auth.) but it does that now as well. But with Auth-Header it would be half the requests.
guruz commentedon Oct 28, 2014
This is where we could achieve double performance for the update phase of a sync run. (assuming that a unauthed request and an authed response take the same time and not taking into account how the file scanner might pre-cache some info)
Two comments I got to this one:
directDownloadUrl(dDUwebdav propery). With that, the client could directly go to the mounted instance (without going through the middleman instance). I understand that this is not possible/desired in all situations though (firewalls, abstractions, information hiding etc)PVince81 commentedon Oct 28, 2014
Note: streaming download might be achievable for WebDAV at least (but not all backends would support this). I believe there's a PR from someone that already provides this: #10620
PVince81 commentedon Oct 10, 2016
The PR that adds the Auth header was closed because it broke stuff: #11826
The proposed extended approach is described here: #11826 (comment)
PVince81 commentedon Oct 10, 2016
Auth header is already passed as I've observed in #12228.
lock commentedon Aug 3, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.