Client side web service caching

  • Thread starter Thread starter Vikas
  • Start date Start date
V

Vikas

Hello,

I am consuming a webservice from a ASP.NET web application. Inside the
constructor of the web service, there is lots of heavy operations
happening like opening a database connection. As a result, the
performance of the web service call is degrading, especially when
multiple users connect to the same web service.

Can there be a way where I can cache the web service object consumed in
the web page? Or something else that can boost the performance of my web
page.
I have very little control on how the web service implementation can be
changed.

Thanks in advance.
 
Vikas,

Do you have connection pooling enabled for the database connections in
your app? If you are opening the database connections in the constructor,
then where are you closing them? If you are closing them in your individual
methods, then that pattern is a little inconsistent, IMO. If you arent
closing them in the methods, then your connections are hanging around
because Dispose is not being called on your object, and you are not closing
the connections.

You should create the database connection in the method itself, and
close it (preferably place it in a using clause) to ensure that you don't
leak resources.

Also, you might get some better performance by using ServicedComponents
that are pooled, and then called by the web service (this way, you can help
cut down on construction costs).

Hope this helps.
 
Back
Top