APGen Documentation Previous Topic: ASPCache Documentation Next Topic: Collection Functionality Parent Topic: ASPCache Documentation    ASPCache Documentation
Introduction to ASPCache
See Also:

ASPCache™ is a high-performance, thread-safe, collection component designed to make it easy to cache information in Active Server Pages.  As a collection component, ASPCache performs 20+ times faster than the ASP Application object.  ASPCache supports: Adding, updating, retrieving, and removing cached items; flushing of items that have not been used in a while; expiration of items after they have lived in the cache for a period of time; and page fragment caching. 

To use the ASPCache component with Application scope, declare it in global.asa:

REM  *** global.asa ***

<OBJECT RUNAT=Server SCOPE=Application ID=Cache PROGID=ASPCache></OBJECT>

This object can be used in any ASP page to store and retrieve data:

<%
'  *** test_cache.asp ***

' Store a value in the Cache object
Cache("key1") = value1

' Retrieve a value from the Cache object
value2 = Cache("key2")
%>

It can also be used to cache web page fragments and write them to the ASP Response object:

<%
' Cache and write the frag1.htm file to the Response object
bSucceeded = Cache.WriteFile("frag1.htm")
%>

See these topics for more information: