last day (15 days later) » 

10:54 PM
0
Q: EWS Managed API synchronization cache location

OranWhen using the Exchange Web Services (EWS) Managed API to synchronize a folder hierarchy or synchronize items, where is the client-side cache located? Is it in-memory only? Is it on disk? Is there a way to find or control where the cache is located? I can't seem to find information on this an...

 
What "client-side cache" are you referring to? The article you mention doesn't refer to any such cache, nor does the API documentation for SyncFolderHierarchy and SyncFolderItems. You'd use the documented approach and APIs to synchronize the contents of (some folders in) a mailbox from Exchange to whatever system you'd like to store them in.
 
That's sort of my question: what is the client-side cache? (which isn't mentioned anywhere in the documentation) What client-side data store is the server-side data being synchronized to?
 
The API simply allows you to access the data in Exchange. It's synchronized that whatever you synchronize it to. The article describes synchronization, because that is the common use-case for it (you get a state "cookie" back with every call that allows you to continue from that point).
You might also be served by this article: msdn.microsoft.com/en-us/library/office/…. It describes the whole approach to synchronization from a somewhat higher level and with (in my opinion) better examples.
 
Yes, I've read that and a million other articles. Are you saying that the client-side synchronization cache is nothing more than the ChangeCollection<ItemChange>?
This article msdn.microsoft.com/en-us/library/office/… has a nice diagram showing two different synchronization patterns: initial synchronization, and ongoing synchronization. Ongoing synchronization implies there is some kind of semi-persistent client-side cache that is receiving deltas.
Or does "synchronization" really mean "just send me deltas and a timestamp and I'll do what I want with the deltas"? That would explain my confusion.
thanks
 
Hey Oran, the synchronization features of EWS are based on ChangeCollection<T> and the SynchronizationState in there. There is no such thing as the "cache" that you refer to, unless you create it yourself.
 
10:56 PM
So it's really just sending down deltas from the last SynchronizationState?
 
Yup.
For its purpose it's a really tidy API. The code samples in the articles you linked earlier allowed me to get started with it quite quickly.
 
and if you happen to persist the state cookie and replay it the next time your app starts up, the assumption is that you've managed to cache a copy of what has come before (using a technique of your choosing), so the server doesn't need to send it again?
 
You start with a SyncFolderHierarchy loop. Then you loop over all folders and SyncFolderItems for each of them. For both cases you have to keep the SyncState somewhere and of course the actual items that you pull down from EWS.
 
so if you build your app correctly, you only ever go through the initial synchronization loop once, and from then on you only do the ongoing synchronization pattern, even across app restarts?
 
Yes to that previous question: you should indeed only store the new SyncState **after(( you process all items in the ChangeCollection
And indeed: I have a few local folders that contain synchronized mailboxes. I only pulled down the full contents once, and since then simply pull down the deltas.
 
11:01 PM
cool! so this means that I don't have to truly synchronize everything down to my client, I can pick and choose and tell the server "I'm all synced up, what's next?" even though I've ignored most of the items?
 
Nope. How would you get the first SyncState?
 
By calling SyncFolderHierarchy and/or SyncFolderItems as many times as it takes to process through all the existing items?
 
Ah OK. And then simply not downloading them?
 
and ignoring most of what it tells me?
right
 
That works. I've done that a lot, before I wrote the code to download the items.
 
11:02 PM
in my case all I'm interested in is processing a subset of meeting invite responses in the inbox
 
OK. Should be possible. I'd just start writing some code against the EWS API and post another question when you have a problem.
 
excellent, I have a much clearer understanding now (I still think "sync" is misleading, but it makes a bit more sense now). Thanks a TON for your helpful insights!
Are you interested in writing an official answer to the question, or would you prefer I do it? It doesn't matter either way to me.
 
11:28 PM
Yup, will do.
 

last day (15 days later) »