Public Sub setCache(ByVal strName, ByVal varValue, ByVal dtmExpires)
    vbsre.cache(strName) = varValue
    vbsre.cache(strName & ".Expires") = dtmExpires
End Sub

Public Function getCache(ByVal strName)
    If Exists(strName) = False Then
        getCache = Empty
    ElseIf IsObject(vbsre.cache(strName)) Then
        Set getCache = vbsre.cache(strName)
    Else
        getCache = vbsre.cache(strName)
    End If
End Function

Private Function Timeout(ByVal strName)
    Dim dtmExpires
    dtmExpires = vbsre.cache(strName & ".Expires")
    If IsEmpty(dtmExpires) Then
        Timeout = True
    Else
        Timeout = CBool(DateDiff("s", dtmExpires, Now()) > 0)
    End If
End Function

Private Function Exists(ByVal strName)
    If IsEmpty(vbsre.cache(strName)) Then
        Exists = False
    ElseIf Timeout(strName) Then
        Exists = False
        delCache strName
    Else
        Exists = True
    End If
End Function

Private Function delCache(ByVal strName)
    vbsre.delCache strName
    vbsre.delCache strName & ".Expires"
End Function
