捌度空间 缓存类

捌度空间 缓存类代码
复制代码 代码如下:

<%
class Cache
    private obj            'cache内容
    private expireTime        '过期时间
    private expireTimeName    '过期时间application名
    private cacheName        'cache内容application名
    private path            'url

    private sub class_initialize()
        path=request.servervariables("url")
        path=left(path,instrRev(path,"/"))
    end sub

    private sub class_terminate()
    end sub

    public property get blEmpty
        '是否为空
        if isempty(obj) then
            blEmpty=true
        else
            blEmpty=false
        end if
    end property

    public property get valid
        '是否可用(过期)
        if isempty(obj) or not isDate(expireTime) then
            valid=false
        elseif CDate(expireTime)<now then
                valid=false
        else
            valid=true
        end if
    end property

    public property let name(str)
        '设置cache名
        cacheName=str & path
        obj=application(cacheName)
        expireTimeName=str & "expires" & path
        expireTime=application(expireTimeName)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2907.html