Sams Teach Yourself ASP.NET in 21 Days, Second Edition By Chris Payne
Table of Contents
Day 14. Using ASP.NET's Improved Caching Capabilities
This workshop will help reinforce the concepts you've learned in today's lesson. Answers can be found in Appendix A.
What's the difference between server-side and client-side caching?
Which caching mechanism stores cached data on the computer's hard drive?
What are the pros and cons of using the Cache class instead of output caching?
What's the difference between the SetExpires method and the SetMaxAge method of the Response.Cache object?
What's the full signature of the Cache.Add method?
Suppose you have a page that accepts the following querystring parameters: userid, searchstring, pagenumber, and orderby. Using VaryByParams, which items should you cache by, and what's the required code?
Using Listing 14.5 as the basis for your testing, measure the performance benefit of retrieving the DataView from the cache instead of creating it explicitly. (Hint: use the Ticks property of the DateTime instance to return a small measure of time 100-nanosecond blocks, or 1-ten-millionth of a second.) Discuss the difference in time.