@rfc2822 I think the synchronization process of DAVdroid is not really efficient. I’ve got an owncloud instance with 10 calendars. Each has events of multiple years.
When syncing (no force sync) DAVdroid does the following for <b>every</b> calendar:
Request
22:24:52: DAVdroid/0.5.6-alpha - bastei, PROPFIND - 117 - /owncloud/remote.php/caldav/calendars/bastei/cal_1/
<propfind xmlns="DAV:">
<prop>
<CS:getctag xmlns:CS="http://calendarserver.org/ns/"/>
</prop>
</propfind>
Now owncloud responses with the ctag of the calender and <b>“404 Not Found” for every event</b> of the calendar, because they don’t have ctags.
Next request:
22:24:53: DAVdroid/0.5.6-alpha - bastei, PROPFIND - 134 - /owncloud/remote.php/caldav/calendars/bastei/cal_1/
<propfind xmlns="DAV:">
<prop>
<CS:getctag xmlns:CS="http://calendarserver.org/ns/"/>
<getetag/>
</prop>
</propfind>
The response of owncloud <b>contains the same as the previous</b>, but now contains the etags for every event.
As I said, this is done for every calendar. All in all one synchronization is about 1 MB download, if nothing changed. Most of it redundant and unnecessary information.
<hr/>
Here comes my suggestion:
- Get the ctags of the calendars from the “root”:<br/><code>PROPFIND - /owncloud/remote.php/caldav</code><br/>So you only get the ctags for the calendars, not the events (10 entries for me vs. 1000+).
- For every changed ctag, get the etags (second request)
- Make use of REPORT with <b>time-range</b> (https://github.com/rfc2822/davdroid/issues/76) for 2.! Here is an example:
REPORT - /owncloud/remote.php/caldav/calendars/bastei/cal_1/
<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
<d:prop>
<d:getetag />
</d:prop>
<c:filter>
<c:comp-filter name="VCALENDAR">
<c:comp-filter name="VEVENT">
<c:time-range start="20131019T000000Z"/>
</c:comp-filter>
</c:comp-filter>
</c:filter>
</c:calendar-query>