简体   繁体   中英

C# EWS read 500 email accounts

I need to create an application to read 500 exchange email accounts, I am using EWS and AutodiscoverUrl.

As per Microsoft documentation is a best practice cache the autodiscover response and use autodiscover for each mailbox one wants to read, I have two questions:

  • For caching I am planning to use the System.Runtime.Caching dll; is it this the best approach? Can you advise on a better solution?
  • Should I use autodiscover for every mailbox that I want to read, even though all they are in the same server?

PS

I'm using EWS Managed API and want to cache only the EWS URL.

The autodiscover response is just XML . In theory, you can cache it any number of ways (eg the AppDomain cache, Caching application block) but System.Runtime.Caching.MemoryCache seems to be the recommended in process cache for .Net 4 and up. If your are talking about a web app, I guess you might consider the HttpCache.

Regarding caching for each mailbox, I think the answer is yes. You would cache the Autodiscover endpoint information, and then invoke GetUserSettings for each mailbox, using the cached Autodiscover information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM