Cross-server communication in the load balanced ASP.NET web application

My ASP.NET application stores some expensive (loaded) data in static fields accessible by the application (in this case using System.Web.Caching.Cache is ​​Inappropriate).

My application is also load balanced on several web servers with a central SQL Server on another machine.

Sometimes This cache will be invalidated. If the user submits some updated data on Server01, then the application knows that it can also clear its local cache when it also submits the data to the database.

But, how about Server01 Notify Server02 of this change so that Server02’s cache is invalidated?

I don’t know any built-in inter-server IPC for web-farm communication in ASP.NET, it seems that I have to create a URI handler in the application (e.g. http://mysite/InvalidateCache) Called by other servers, but it seems a bit hackish. Is there a better way?

I’m a little bit brainy and realize that web servers can communicate with each other only by sending each other’s requests – No special side channel cable is required. I previously called this idea hackish, but it is theoretically reasonable.

Obviously for security reasons, these requests need to be connected through a physical private network , Or a request with a cryptographic signature, but I really can’t figure out what is wrong with this method now.

My ASP.NET application is accessible in the application Some expensive (loaded) data is stored in the static field (in this case it is inappropriate to use System.Web.Caching.Cache).

My application is also Load balancing on several web servers with a central SQL Server on another machine.

Sometimes this cache will become invalid. If a user submits some updated data on Server01, then the application knows it It can also clear its local cache when it submits data to the database.

However, how does Server01 notify Server02 of this change so that Server02’s cache is invalid?

I don’t know any built-in inter-server IPC for web-farm communication in ASP.NET, it seems that I have to create a URI handler in the application (e.g. http://mysite/InvalidateCache) Called by other servers, but it seems a bit hackish. Is there a better way?

I’m a little bit brainy and realize that web servers can communicate with each other only by sending each other’s requests-no special side channel wires are required. I called it earlier The idea is hackish, but it is theoretically reasonable.

Obviously for security reasons, these requests need to be connected through a physical private network, or have a cryptographically signed request, but I am really now Can’t think of any problems with this method.

Leave a Comment

Your email address will not be published.