APGen Documentation Previous Topic: ASPCache.WriteFile() Next Topic: CachedFile.Contents Parent Topic: ASPCache Object Reference    ASPCache Object Reference
CachedFile Object
See Also:

The CachedFile object is a thread-safe COM object that caches a file's content and optionally monitors the file for changes.  CachedFile objects are stored in ASPCache objects to implement page-fragment caching.

ProgID

"WebGecko.CachedFile.1"

Version Independent ProgID

"WebGecko.CachedFile"

CLSID

CLSID_CachedFile, found in <ASPCache install dir>\include\ASPCache.h

Properties

Contents String (r) Returns the contents of the cached file as a string.
MonitoringFileChanges Boolean (r) Returns true if the cached file is being monitored for changes.

Methods

Open() Opens a file, and caches its contents.
Write() Writes the contents of the cached file to the ASP Response object.

Notes

CachedFile objects are used for page fragment caching, but they can also be accessed directly:

' This code snippet assumes that fragments/frag.htm was previously cached using Cache.WriteFile
' Retrieve the CachedFile object
Dim oCachedFile
Set oCachedFile = Cache("fragments/frag.htm")

' Read the CachedFile object's properties
Dim sContents, bMonitoringFileChanges
sContents = oCachedFile.Contents
bMonitoringFileChanges = oCachedFile.MonitoringFileChanges