Client Uses Client-Side Conflict Detection
Topic Last Modified: 2006-06-12
The following scenario uses client-side conlict detection to avoid downloading content from the server:
The client has previously fetched the Manifest of a Collection and the collblob for a collection doccoll and requests an updated collblob and Manifest of a Collection.
Request
SEARCH /doccoll HTTP/1.1
Host: example.com
Content-type: text/xml
Content-length: 92
<?xml version="1.0"?>
<D:searchrequest xmlns:D="DAV:"
xmlns:R="https://schemas.microsoft.com/repl/"
xmlns:M="urn:schemas:mail:">
<R:repl>
<R:collblob>clientopaquedata</R:collblob>
</R:repl>
</D:searchrequest>
Response
HTTP/1.1 207 Multi-Status
Content-type: text/xml
Content-length: 752
<?xml version="1.0"?>
<D:multistatus xmlns:D="DAV:"
xmlns:R="https://schemas.microsoft.com/repl/"
xmlns:M="urn:schemas:mail:">
<R:repl>
<R:collblob>clientopaquedata</R:collblob>
</R:repl>
<D:response>
<D:href>https://server/doccoll/msg1</D:href>
<D:propstat>
<D:status>HTTP/1.1 200 OK</D:status>
<D:prop>
<D:Size>1000</D:Size>
<M:Importance>High</M:Importance>
<R:resourcetag>rt:doc1-01</R:resourcetag>
</D:prop>
</D:propstat>
<R:ChangeType>change</R:ChangeType>
</D:response>
<D:response>
<D:href>https://server/doccoll/msg4</D:href>
<D:propstat>
<D:status>HTTP/1.1 200 OK</D:status>
<D:prop>
<D:Size>14400</D:Size>
<M:Importance>High</M:Importance>
<R:resourcetag>rt:doc1-01</R:resourcetag>
</D:prop>
</D:propstat>
<R:ChangeType>change</R:ChangeType>
</D:response>
</D:multistatus>
Later, while the client is offline, document docE in the collection doccoll is updated. The client then downloads document docE and the server returns the contents of document docE and its corresponding resourcetag as follows:
Request
GET /doccoll/docE HTTP/1.1
Response
HTTP/1.1 200 OK
Resourcetag: <rt:19a23000c26511d18faf00600892444c>
Content-type: text/plain
Content-length: 42
This is the content of text document docE.
The client then saves the contents of the document docE and its resourcetag. After a period of time, the client wants to determine what, if anything, has changed since the last time it synchronized with the server. The client sends a request for the Manifest of a Collection and the resourcetag Field on the collection 'doccoll' by including its previous collblob in the request. The server responds with a manifest that includes the change corresponding to docE. The client doesn't want to unnecessarily re-download documents, so it compares the resourcetag that was obtained as part of the manifest with the resourcetag it persisted previously for document docE. By doing so, the client finds that it already has the latest version of the document docE.