'Controller is not initializing when run frontend server using load balancer
Im facing an issue in a Load balancing environment where my code is running fine on single server but in a load balancing environment only static value is showing.
i have created a ASP.NET MVC app which show user name like this "Hello {UserName} Welcome to the site"
In controller im fetching the current username and adding the username to the welcome message such that whoever open is their name will be shown on welcome.
Every time the page load the controller is getting hit and the name assignment is done. this is working fine on my local and on the single server environment.
But when i try to deploy the code on load balancing environment having two frontend servers and one backend server. like edit.abc.com as backend server, go.abc.com as frontend server(having two server)
On Backend Server logic run fine every different user who saw the page their name is getting displayed but when i try to open the same page using frontend server im only seeing one name whoever opened the page first.
on frontend server the controller is getting initialized only once hence the static name is showing whoever open that page first.
How can i make the code on frontend server as well getting initialized on every page visit or any other suggestion to resolve this issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
