There are a couple of issues we need to address because of the change:
- when put a object in session, make sure it is Serializable, so later in the clustered environment, if you manage session in sql server, it can be stored in sql server
- We were using a third party control for uploading images called I-Load which created some issues with temp image folder, luckily we fixed it. So when buying third-party control like ILoad, make sure it supports web farm
- We were using a third party control called DynamicControlsPlaceholder which does not work in cluster environment until we modified it a bit to make it work
- view state needs to have shared machinekey set up in web.config for web farm environment (in iis7 use sharekey section to share key with other web servers in the farm, then use iis7 to generate unique machinekey for every application in the iis, so that applications do not interrupt with each other)
- Cache & Application variable
- The cached object is stored in process, which means it doesn’t persist if the application domain is restarted and it can’t be shared between computers in a web farm.
- Once a worker process recycles, the entire Cache is lost because it was within this process.
- Microsoft has tried to fix this a bit with SQL Server cache invalidation (ASP.NET Cache SqlCacheDependency), but it could have potential performance issue and according to Scott Watermasysk he has not seen many be successful with this approach.
- There are a couple third party tools to fix this: Memcached ScaleOut NCache SharedCache
- The good news is Microsoft is making some strides here. They are working on an out of processing caching component called Velocity.
- We have to get rid of cache and application variables to address the problem