Configure WebClient for faster downloads

What am I doing

I am trying to port a Classic Asp application to ASP.NET MVC. The classic app has been written for 15 years. There is no way to write a new project and transfer all the code in one moment. The business application should work around the clock.

What solutions did I find

I did not find a good solution. One piece of advice I found begins with the words, β€œI feel your pain, brother.” A business cannot provide such human resources for global refactoring. So the only way I found is to write some kind of proxy using WebClient.

Architecture

I have an IIS server hosting the Classic ASP application. I will add an MVC application next to it. Each request received by the server will be managed by the MVC project. If there is an action requesting a request, the MVC application will work as usual. Render view, return to the client. If there is no such action, the controller will call Classic ASP using the HandleUnknownAction method. This way, it will do some work by processing the URL and cookies, and eventually the Classic Asp application from WebClient.DownloadString() . The return line (HTML response) will be inserted as content on the page (headers, footers are in the MVC layout). It should be mentioned - the project is not allocated, but next to it. Therefore, I can transfer the old code in small parts. Actions by actions without any impact on the application. Just by creating action methods in MVC.

Requirements

  • The response time will increase significantly.
  • There are no alternatives.

Question

I want to know every possible chance to speed up such a web application. Perhaps by configuring WebClient or so. Are there any settings for this? Maybe some tips on managing a Webclient pool? I don’t need to do cross-server queries - do any abilities open? Maybe this is the place for asynchronous calls? Or reorganize the server structure?

Thanks for any advice!

+5
source share

Source: https://habr.com/ru/post/1206544/


All Articles