July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Content preview from Visual Basic 2015 UnleashedBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
Start your free trial


The Cache State
The ASP.NET Cache has the same scope of Application, meaning that both can be accessed by all page requests. The primary difference is that Cache enables holding information in memory, which avoids the need of re-creating and retrieving objects. This is good if you want to maintain updatable objects but could cause overhead (always considering that the bigger the amount of data to transfer, the lower the performance) because it requires memory. So, it should be used only when needed or when you ensure that performance is acceptable. The following is an example of storing and retrieving information with Cache:
Cache("MyUpdatableDataKey") = "My updatable data"Dim myUpdatableData As String = CStr(Cache("MyUpdatableDataKey")) ...