Is HttpRuntime Cache unique for each user in ASP.NET as well as the Sessions?
2 Answers
No, the HttpRuntime Cache is stored on the server side, and is valid application-wide.
1 Comment
Guffa
Correct, but not because it's stored on the server side. Session data is also stored on the server side.
The cache isn't unique for each user as @Dan Dumitru said but you could use it in a fake unique way by specifying a unique string as part of the key for the cached data (username or user id from a table etc)...This does of course mean lots of things would be cached depending on usage...it would then be subject to all the usual cache scenarios
Function GetDataFromCache() As Object
Return Cache.Item(String.Concat(My.User.Name, "SomeDataThatIsCachedForEachUser"))
End Function
1 Comment
SLaks
There is no point in manually calling
String.Concat. Use the + operator.