Eight-degree space cache class code
The code copy is as follows:
<%
classCache
privateobj'cache content
privateexpireTime'Expiration Time
privateexpireTimeName'Expiration Time Application Name
privatecacheName'cache content application name
privatepath'url
privatesubclass_initialize()
path=request.servervariables("url")
path=left(path,instrRev(path,"/"))
endsub
privatesubclass_terminate()
endsub
publicpropertygetblEmpty
'Is it empty
ifsempty(obj)then
blEmpty=true
else
blEmpty=false
endif
endproperty
publicpropertygetvalid
'Whether it is available (expired)
ifsempty(obj)ornotisDate(expireTime)then
valid=false
elseifCDate(expireTime)<nowthen
valid=false
else
valid=true
endif
endproperty
publicpropertyletname(str)
'Set cache name
cacheName=str&path
obj=application(cacheName)
expireTimeName=str&"expires"&path
expireTime=application(expireTimeName)
endproperty
publicpropertyletexpires(tm)