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

Enables/disables background flushing and expiration.

Syntax

VBScript:

Cache.FlushEnabled = bEnabled

JScript:

Cache.FlushEnabled = bEnabled;
Object

Cache An ASPCache object.

Parameters

bEnabled True enables flushing; False disables flushing.  The default is False.

Notes

By default, flushing is disabled.  When flushing is disabled, the background cleanup thread does not run.

Setting FlushEnabled to True enables periodic background removal of unused items and expired items from the cache.  This background removal occurs on a lower-priority cleanup thread.  Since the cleanup thread is lower priority than the web server threads, cleanup does not slow the handling of HTTP requests.  The cleanup thread uses CPU cycles that are left unused by the web server.

Other properties related to flushing are FlushTimeout and FlushInterval.  For more information on flushing, see Flushing.

Flushing settings affect all items in an ASPCache object.  (Expiration is a per-item setting.)  If you need to make some items flushable, and other items non-flushable, create two Cache objects:

' *** global.asa ***

' TempCache holds items that may be flushed
' PermCache hold items that will never be flushed
<OBJECT RUNAT=Server SCOPE=Application ID=TempCache PROGID=ASPCache></OBJECT>
<OBJECT RUNAT=Server SCOPE=Application ID=PermCache PROGID= ASPCache></OBJECT>

<SCRIPT LANGUAGE=VBScript RUNAT= Server>

Option Explicit

Sub Application_OnStart
     ' Initialize the TempCache object so flushing occurs
     TempCache.FlushEnabled = True
     TempCache.FlushTimeout = 120000
     TempCache.FlushInterval = 60000
End Sub
</SCRIPT>