APGen Documentation Previous Topic: ASPCache.Enabled Next Topic: ASPCache.FlushEnabled Parent Topic: ASPCache Object    ASPCache Object
ASPCache.MaxSize
See Also:

Sets/retrieves the maximum number of items to hold in the cache.

Syntax

VBScript:

Cache.MaxSize = nMaxSize

JScript:

Cache.MaxSize = nMaxSize;
Object

Cache An ASPCache object.

Parameters

nMaxSize The maximum number of items to hold in the cache.  If 0, no maximum size is enforced.

Notes

The default value for MaxSize is 0, which means there is no maximum size.

When the number of items in the cache (Count) exceeds MaxSize, reading and writing to the cache continues working normally.  However, the oldest items are removed from the cache to shrink the cache so that Count equals MaxSize.  A background thread searches the cache for the oldest items, and removes them.  The number of old items that are removed is equal to the difference between MaxSize and Count.

The background thread does not lock the cache while searching for the oldest items.  Items can be read from and written to the cache while the background search is occurring.

The MaxSize property enables and disables cache shrinking.  Shrinking is one technique exposed by ASPCache to limit cache resource consumption.  Other available techniques for limiting resource consumption are expiration and flushing.