1

I have a WCF service that uses various config parameters that are located in a database, as well as a cache for better performance. Right now I have a Singleton that holds this information and is initialized on the first call to the Webservice in a lazy loading behavior.

The cache was exenteded lately and so the initialization takes some time, of course resulting in a longer response time on the first service request.

So what would be the most efficient way to do some kind of eager loading initialization of the service before the fist call occurs (probably on application pool start)?

hecko84
  • 1,224
  • 1
  • 16
  • 29

1 Answers1

0

Don't host the service in an asp.net application, but use a self-hosting process (i.e. a console application) or (even better) a WAS (Windows Activation Service) service within IIS.

This is much more reliable and you can initialize service BEFORE first clien call.

See MSDN for details.

Stefano Altieri
  • 4,550
  • 1
  • 24
  • 41