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

Implement ETags for synchronization Speed-Up #359

Closed
stefan-niedermann opened this issue Apr 4, 2020 · 2 comments
Closed

Implement ETags for synchronization Speed-Up #359

stefan-niedermann opened this issue Apr 4, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@stefan-niedermann
Copy link
Owner

stefan-niedermann commented Apr 4, 2020

This issue depends on nextcloud/deck#1650

Basically each GET-response from the server will contain an ETag-header. This header has to be stored in the clients database.

On each GET-request the client will have to add a If-None-Match-header with the value of the previously stored ETag-header. Of course it can be null or empty if it is the first request to this resource.

If the resources have changed since the last request, the response will be like today - containing everything. In this case we should proceed like today.

But, and this is the actual benefit: If the If-None-Match-header matches the current ETag of the server, the server will simply respond with a http status code 304 because nothing has changed. First benefit is, that we don't have to transfer much json-data, but the incredible speed up will come from our custom ETag-implementation we discussed in nextcloud/deck#1650 (comment): If we receive for example for a board the status code 304, we do no longer need to go deeper for the sync. This means: If we receive 304 on a board, we automatically know, that all descendants also haven't changed and we therefore don't need to query them. cool, huh?

So benefits:

  1. Less data transfer for the current items
  2. Less requests, because if nothing has changed, we don't have to query the descendants

The best thing of it: We can already start implementing it, because the If-None-Match-header is currently completely ignored. It will simply start working as soon as the server part has been finished 🙂.

@stefan-niedermann
Copy link
Owner Author

The server app has implemented support for ETags starting with version 1.2.0-beta1.

@stefan-niedermann
Copy link
Owner Author

Will be shipped with 1.13.0.

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

No branches or pull requests

2 participants