Last post Sep 08, 2010 08:39 PM by DigiMortal
Sep 08, 2010 08:00 PM|ricksi|LINK
I'm using the code below (a shortened version as a test). It is invoked on application start and collects data for use by the individual sessions. The problem I'm having is it doesn't work on one machine but is fine on the other
Is using .Clone the correct way of caching or is that the cause of my problems?
Public Shared Sub LoadGroups()
Dim arrGroups As New ArrayList
for i = 1 to 100
arrGroups.Add("test" & i)
HttpRuntime.Cache("Groups") = arrGroups.Clone
Sep 08, 2010 08:39 PM|DigiMortal|LINK
You don't have to clone your groups because cache in ASP.NET is synchronized. You can read more about locking considerations from article
Synchronizing Cache Access in ASP.NET. The article just shows you some situations where you might need locks.