WEBSITE

Impact of Caching

9/25/2010 11:34:52 AM
If you included the Trace statements in the GetInventory method, you can surf to the trace page to see the effect of caching. The UseDataCaching application included here has the Trace attribute turned off in the page but has application tracing turned on. That is, the web.config includes the following section:
<configuration>
<system.web>
<trace enabled="true" />
<system.web>
</configuration>

You can see the trace information by surfing to the virtual directory with a file name of Trace.axd. Instead of surfing to the UseDataList.aspx file, surf to the Trace.axd file in the same directory.

Figure 1 shows the trace statements produced by accessing the page for the first time. The column farthest to the right indicates the time elapsed since the previous trace statement. The trace statement shows that more than 0.016 seconds has elapsed during the page loading time.

Figure 1. Hitting the database takes more than half a second in this scenario.


Make a few more posts to the page (for example, add some items from the inventory to the selected items grid). Then, go back and look at the tracing information for the subsequent postbacks. Figure 2 shows some examples of trace statements. Fetching from the Cache is dramatically faster than hitting the database—by several orders of magnitude! Again, you might not notice the difference with just one client surfing the page every once in a while. However, when multiple clients are surfing to the same page simultaneously, they'll get their responses much more quickly than if the page had to make a round-trip to the database.

Figure 2. Fetching data from the cache takes 0.000040 seconds.


Other  
 
Top 10
Mobile Application Security : The Apple iPhone - Push Notifications, Copy/Paste, and Other IPC
Exploring the T-SQL Enhancements in SQL Server 2005 : The WAITFOR Command
Parallel Programming with Microsoft .Net : Parallel Aggregation - Variations
Optimizing an Exchange Server 2010 Environment : Analyzing Capacity and Performance
Programming .NET Security : Hashing Algorithms Explained
Sharepoint 2007: Specify Your Colleagues
Algorithms for Compiler Design: THE NFA WITH ∈-MOVES
Choosing The Right Parts For Your Build (Part 1) - Picking the perfect processor
Choosing The Right Parts For Your Build (Part 5) - Choosing your case & Picking the right storage
SQL Server 2008 : Leveraging the Microsoft Sync Framework
Most View
Legal Trouble with Social Networks (Part 1)
The choices of mobile computing for SOHO users (part 2)
Infrastructure Security: The Application Level
Sharepoint 2007: Create a New List Item
SQL Azure Data Access
Getting Started with MySQL Enterprise & MySQL Enterprise Components
iPhone Application Development : Using Advanced Interface Objects and Views - User Input and Output
How to Protect Your Mobile Devices
Joomla! Blogging and RSS Feeds : Commenting anyone?
The Second BlackBerry Developers Conference Asia (Part 2)
Windows Azure : Understanding the Blob Service
Windows Server 2008 : Understanding the Identity Management for UNIX Components
Migrating from Legacy SharePoint to SharePoint Server 2010 : Using Visual Upgrade
Designing and Implementing Mobility in Exchange Server 2010 : Securing Access to ActiveSync Using Internet Security and Acceleration (ISA) Server 2006
SQL Server 2008 : Explaining Advanced Query Techniques - Creating CTEs
Configuring Server Roles in Windows 2008 : New Roles in 2008
Mass Effect Infiltrator
iPhone 3D Programming : Anti-Aliasing Tricks with Offscreen FBOs (part 1) - A Super Simple Sample App for Supersampling
Changes in Windows Vista Affecting SDI
Search for a File or Directory