Skip to content
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

A dav plugin to allow pagination of multipart responses #10880

Closed
wants to merge 1 commit into from

Conversation

icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Aug 27, 2018

Adds the option for clients to get paginated results for PROPFIND, REPORT and SEARCH, the server will still query everything at once, but only sending the first page worth of data to the client while caching the rest.

Proper pagination is needed to be able to properly handle large responses on mobile clients that can otherwise run into memory issues while handling the response.


How to use

Initial request

  • prepare a PROPFIND, REPORT or SEARCH request as usual to the dav endpoint (the old webdav endpoint isn't supported by this)
  • add X-NC-Paginate: true header to tell the server we want pagination
  • optionally add a X-NC-Paginate-Count: X header with the number of results to return (defaults to 100)

The result will contain the first X items and the following headers

  • X-NC-Paginate: true: to signify that the response is paginated
  • X-NC-Paginate-Token: XXXXXXX: the token to request the rest of the results
  • X-NC-Paginate-Total: X: the total number of items

Follow up requests

  • While sending the same base dav request as above
  • add X-NC-Paginate-Token: XXXXXXX header with the returned token
  • add X-NC-Paginate-Offset: X the first item to return
  • optionally add X-NC-Paginate-Count: X to control the number of items returned.

The result will have the requested items and the X-NC-Paginate: true header.

Note that any follow up request will not reflect any changes that are made on the server since the original request.


Support for pagination on the server can be determined from the DAV header of OPTIONS requests, which will contain nc-paginate if the feature is supported.

Cached results are cleaned up after an hour.

@MorrisJobke
Copy link
Member

Proper pagination is needed to be able to properly handle large responses on mobile clients that can otherwise run into memory issues while handling the response.

Usually XML can be parsed while reading the stream as well. 🤔

@icewind1991
Copy link
Member Author

The problem is not parsing the xml, the problem is that the mobile client will have to keep the full file listing in memory.

@MorrisJobke
Copy link
Member

The problem is not parsing the xml, the problem is that the mobile client will have to keep the full file listing in memory.

True point 👍

@MorrisJobke
Copy link
Member

Could you rebase this one?

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Oct 24, 2018
@MorrisJobke MorrisJobke mentioned this pull request Nov 7, 2018
29 tasks
@MorrisJobke MorrisJobke modified the milestones: Nextcloud 15, Nextcloud 16 Nov 7, 2018
@MorrisJobke
Copy link
Member

Moved to 16.

@mario
Copy link
Contributor

mario commented Nov 7, 2018

So um, what happened with this one? Can I help to make it happen? It was done so early in the cycle that I really thought it'd get in :(

@MorrisJobke
Copy link
Member

Getting it rebased and reviewed tomorrow morning would make it happen. Otherwise I’m sorry, but sometimes things go under the radar and are forgotten somehow.

@mario
Copy link
Contributor

mario commented Nov 8, 2018

I have now rebased this. Please let me know if I can assist any further @icewind1991.

@marinofaggiana
Copy link
Member

Yes yes yesssss, for me this is very very gooooodddddd

@tobiasKaminsky
Copy link
Member

@icewind1991 this will not speed up first search?
On my productive system it takes 35s to generate a response (with cURL):

  • 27k photos
  • out of 30476 files

Is there something I can do from client side to get this faster? I already ask for as few properties as possible.

@MorrisJobke MorrisJobke mentioned this pull request Mar 4, 2019
45 tasks
@rullzer rullzer removed this from the Nextcloud 16 milestone Mar 5, 2019
@MorrisJobke
Copy link
Member

@icewind1991 Any news here?

@MorrisJobke MorrisJobke added this to the Nextcloud 17 milestone Mar 20, 2019
@marinofaggiana
Copy link
Member

@icewind1991 Any news here? for mobile its very important

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991
Copy link
Member Author

@tobiasKaminsky can you give me the xml for the search request you're making

@MorrisJobke MorrisJobke mentioned this pull request Jul 15, 2019
28 tasks
@MorrisJobke
Copy link
Member

@icewind1991 What is the status here? We are close to the beta 1. Should this go into 17 or 18?

@marinofaggiana
Copy link
Member

😴

@tobiasKaminsky
Copy link
Member

Cached results are cleaned up after an hour.

One hour after last usage, or one hour after creating the first query?

@ChristophWurst
Copy link
Member

One year without any update? GUess we can close this 🤡

@rullzer
Copy link
Member

rullzer commented Mar 30, 2021

I'm going to close this due to lack of activity.
Feel free to reopen if anybody wants to continue.

@rullzer rullzer closed this Mar 30, 2021
@rullzer rullzer deleted the dav-paginate branch March 30, 2021 19:37
@marinofaggiana
Copy link
Member

marinofaggiana commented Mar 11, 2023

Can we reopen ? After 5 years the clients still no have a pagination ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants