ASPAlliance.com : The #1 Active Server Pages .NET Community The #1 ASP.NET Community
Search   Search

Subscribe   Subscribe

Powered by ORCSWeb Hosting


Site Stats


Powered By ASP.NET
 
Featured Sponsor

Featured Columnist


Featured Book
.NET Enterprise Design with Visual Basic .NET and SQL Server 2000
.NET Enterprise Design with Visual Basic .NET and SQL Server 2000

Find Prices
Sample Chapter


New! asp.netPRO

We publish our articles in the standard RSS format.

Powerful .NET Email Component

Code Sharing Software
Click here to return to my article index

Application Cache Viewer

ASP.NET and the .NET Framework automagically cache pages as they are accessed by site visitors. This obviously speeds up the response time of your website. In addition to ASP.NET's ability to cache pages for us, we are able to store selectively cache items for use in our applications.

Ever wonder what ASP.NET is caching at any given time? I put together a very simple cache viewer that will display items stored in the local applications cache. The way the code is currently written, the cache viewer does not show us the pages that are currently being cached by ASP.NET or the ASP.NET worker processes that are caching various items. However, the code is included in this article so you are free to grab the code and comment out the If..Then logic that prevents the System and ISAPI cache from showing.

Remember that this example is running on my application here on AspAlliance.com and other users may be using the online version of this application. So, you may experience inconsistent behaviour online. I recommend you grab the code and run it on your machine.

First, let's make sure we have added some items to the application cache. We can do that with this simple little script I put together.

Click here to view the addcache.aspx source
Click here to run addcache.aspx and populate the cache

Once you have run the addcache.aspx page, you can run the cache menu application to view the contents of our application cache.

Click here to view the cachemenu.aspx source
Click here to run cachemenu.aspx and view the contents of the cache

If you want to see every item stored in your application cache then comment out the If..Then logic in cachemenu.aspx. There are comments in the downloadable source that tell where you can make this change.

Click here to download the code for both pages (addcache.aspx and cachemenu.aspx)

 Copyright © 2000-2003 ASPAlliance.com  Page Rendered at 10/8/2008 12:37:26 AM