Reputation: 2751
In Web API, is a new instance of the controller created each time the server receives a call? Is there any optimization done per client or does the server not care where the call is coming from? Also, what happens to static members? I would assume that this would depend on the number of appdomains loaded, so technically it is possible to have multiple 'unique' instances of the same static variable across the process.
Can someone point me to some official documentation regarding how objects and app domains are brought up and destroyed to handle HTTP requests for Web API?
Upvotes: 1
Views: 745
Reputation: 1893
Yes, it is a new instance of a controller for each request, I just can't remember any online documentation of it. Here is a great poster showing the life cycle and extension points. Here are some great books that really dissects Web API and have answered most of my questions about the inner workings of it.
Upvotes: 1