0

Is HttpRuntime Cache unique for each user in ASP.NET as well as the Sessions?

2 Answers 2

4

No, the HttpRuntime Cache is stored on the server side, and is valid application-wide.

Sign up to request clarification or add additional context in comments.

1 Comment

Correct, but not because it's stored on the server side. Session data is also stored on the server side.
1

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

There is no point in manually calling String.Concat. Use the + operator.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.