When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Stump the SQL Guru!
XML Info
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
Published: Wednesday, March 20, 2002

A Classic ASP Page Caching Object, Part 2

By Joe Audette

  • Read Part 1

  • In Part 1 we discussed the requirements for the page caching object and how to use it through an ASP page. In this part we look at how to pass in caching instructions through the querystring and performance results of the caching object as compared to ASP pages tested without using the page cache object.

    - continued -

    Specifying Cache Behavior via the QueryString
    Hopefully by now you're impressed with what the page caching object gives you for such little coding. You can further extend the behavior of the page caching object by specifying querystring parameters. That is, for a particular page you can flush the cache regardless of whether or not the cache has expired by including cachecommand=clear in the querystring. The cachecommand key supports the following three values:

    1. You can force the cache to be updated by typing an extra querystring parameter into the URL: cachecommand=create.
    2. You can bypass the cache and force a dynamic rendering of the page by typing an extra parameter into the URL: cachecommand=bypass.
    3. You can clear the cache and force a dynamic rendering of the page by typing an extra parameter into the URL: cachecommand=clear.

    Web Stress Results
    To test the effectiveness of the page cache object I setup a script to run for 1 minute against a single ASP page that returned 385 rows from SQL Server and rendered them in an html table. I configured the script to use the default 200 users and to measure maximum page requests per second. You can download the free Web Stress Tool, and find out more information about it, from: http://homer.rte.microsoft.com/.

    Our test configuration was as follows:

    Single Processor Pentium III 850 MHz
    500 MB SDRAM
    Windows 2000 Server (SP2)
    SQL Server 2000
    Client computer running Web Stress Tool
    Single Processor Pentium II 450 MHz
    256 MB SDRAM
    I.E. 6.0
    Windows 2000 Server (SP2)

    I ran the same script once without the page cache object on the page, once with it on the page configured to use AutoCacheToFile, and once with it on the page configured to use AutoCacheToMemory. The performance counter results were as follows: (your mileage may vary, of course)

    Pure Dynamic ASP
    Number of hits: 511
    Max Requests per Second: 8.54
    TTFB Avg (Time to first byte in milliseconds) 73.22
    TTLB Avg (Time to last byte in milliseconds) 114.57

    Caching To Text Files Enabled
    Number of hits: 849
    Max Requests per Second: 14.93
    TTFB Avg (Time to first byte in milliseconds) 26.36
    TTLB Avg (Time to last byte in milliseconds) 67.91

    Caching To Application Variables Enabled
    Number of hits: 970
    Max Requests per Second: 16.74
    TTFB Avg (Time to first byte in milliseconds) 16.15
    TTLB Avg (Time to last byte in milliseconds) 59.04

    From the results above you see that significant performance gains were realized when caching the page. For complete report output refer to the text files included in the download.

    Happy Programming!

  • By Joe Audette


  • Download the source code (in ZIP format)
  • Download Microsoft's Web Stress Application Tool
  • Information on XMLHTTP

    About the Author, and Article Credits
    Joe Audette MCSD, MCDBA, MCSE is a Web Developer for Transcender LLC in Nashville, TN. Thanks to Jason Wisener for helpful technical review of both this article and the object code. He also helped with the Web Stress Tool testing. Thanks also go to David Neal for planting the seed for the idea which became this object.

    Joe is also a musician and the host of a web site supporting the music community in his home town. http://www.MurfreesboroMusic.com. You can reach him at joe_audette@yahoo.com. Your feedback is welcome.

  • ASP.NET [1.x] [2.0] | ASPFAQs.com | Advertise | Feedback | Author an Article