-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve thumbnail reading performance with more direct access #31054
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Makes sense 👍 A few additional thoughts:
|
I think the token is valid for 5 min maximum, and most of the time less than 5 min. For example: But I like the idea, as loading the previews are very slow for me on web and on mobile too. |
would be good to also get feedback from @tobiasKaminsky here then |
clients to adjust eventually (raise tickets):
|
I see some troubles. Current state on e.g. Android:
With new approach this means:
|
this seems useful mostly for the web UI: Because there we do a propfind on the folder every time, so we already setup the FS and at that moment we know the permissions, so when the thumbnails from that folder are requested, we don't need to check permissions. |
What about binding this to eTag of parent folder?
This then has no implementation on client, but will still help a lot. |
Results of the brainstorming with @tobiasKaminsky
|
Good idea to standardize this! |
As the url is rather fixed/can be easily computed it it big overhead to have it in every response. |
We already do, we generate only for |
Current state
When loading a thumbnail, we do:
Idea how to fix it
The general idea is that we communicate a secret token with the clients when they fetch the list of files in a folder. This secret token is unique for each file and only valid for 5 min. When requesting a thumbnail, we need to pass this token to the request and then with it we can skip the authorization and authentication, as it was already done during the file listing.
Technical explanation
Add a new dav property that contains for each image a
thumbnail_access_token
. Thethumbnail_access_token
is generated with the following expression:hash(fileId + rounded_time + server_secret)
whererounded_time
is theintval(current_timestamp / 60 / 5)
so that validity of the token is only 5 minutes andsecret_server
issecret
from the config.php (an unique identifier for each instance).When requesting a thumbnail, the clients and the webui would need to provide the
thumbnail_access_token
that they previously got from the dav request. If the token is valid, we can skip the authentification and the full file system setup call and only do the appdata setup. If it's not valid or for legacy reasons are not set, we do the authentification and the file system setup.For the web UI, the HTTP header can be set using a web worker. For the mobile and desktop client, it shouldn't be an issue to add an additional header to the requests (I hope)
Advantages
thumbnail_access_token
quickly enough (5 min lifetime) but in that case it's easier to just share the file directly.Disavantages
The text was updated successfully, but these errors were encountered: