I’ve seen several articles on warming up a WCF service when it is hosted in IIS (that is, pre-loading caches, loading plug-ins etc – basically all the expensive stuff you don’t want your users to be hanging around for when they issue their first request), but I haven’t seen anything equivalent for when WCF is self-hosted in a .NET service.
Has anyone been able to achieve this?
If you’re hosting your service, than you can create a client (i.e., using
ChannelFactory<T>) to the service right after you call ServiceHost.Open and issue a “ping” request; that way if the service implementation is doing some heavy loading, it can happen right then, instead of when the first “real” client request arrives.