|
CachedFile Object |
|
See Also: |
Returns the contents of the cached file as a string.
VBScript:
JScript:
| cachedFile | A CachedFile object. |
| sContents | A string containing the contents of the cached file. |
This property behaves the same regardless of whether a file handle is cached or the file contents are cached in memory.
This example performs string replacement on a file fragment before writing its contents to the Response object:
' Retrieve the CachedFile object from the Cache
Dim sFragPath, cf, sFrag
' Use a product page
fragment
sFragPath = "products/prod" & id & ".htm"
If
Cache.Exists(sFragPath) Then
' Retrieve the
CachedFile object from the Cache
Set cf =
Cache(sFragPath)
'
Replace tags within the fragment with the user id
sFrag = Replace(cf.Contents, "<$userid$>",
sUserId)
' Write the page fragment to the ASP
Response
Response.Write
sFrag
Else
' .. error handling
End If