Nextcloud-deck: Implement ETags for synchronization Speed-Up

Created on 4 Apr 2020  路  2Comments  路  Source: stefan-niedermann/nextcloud-deck

This issue depends on https://github.com/nextcloud/deck/issues/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 https://github.com/nextcloud/deck/issues/1650#issuecomment-608682117: 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 :slightly_smiling_face:.

enhancement

Most helpful comment

Will be shipped with 1.13.0.

All 2 comments

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

Will be shipped with 1.13.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

riweckr picture riweckr  路  6Comments

timkrief picture timkrief  路  3Comments

thenickname picture thenickname  路  4Comments

ahangarha picture ahangarha  路  4Comments

cappuMUC picture cappuMUC  路  3Comments