'Temps de cache, minute d'unité
Const webcachetime = 20
'Signe de cache, utilisez-le lors de l'installation de plusieurs systèmes dans un seul espace
Const webcacheflag = cache
«Définissez le nom du cache de cache, valeur de cache
Fonction setcache (byval cachename, byval cacheval)
Cachedata faible
Cachename = lCase (ChangeChr (cachename)))
Cachedata = application (webcacheflag & cachename)
Si isarray (cachedata)
Cachedata (0) = cachevalue
Cachedata (1) = maintenant ()
Autre
Redim cachedata (2)
Cachedata (0) = cachevalue
Cachedata (1) = maintenant ()
Terminer si
Application.lock
Application (webcacheflag & cachename) = cachedata
Application.unlock
Fonction finale
'Obtenez le nom du cache de cache
Fonction getCache (byVal cachename)
Cachedata faible
Cachename = lCase (ChangeChr (cachename)))
Cachedata = application (webcacheflag & cachename)
Si isArray (cachedata) alors getCache = cachedata (0) else getCache =
Fonction finale
'Détecter le nom de dépôt lent du cache
Fonction chkcache (byval cachename)
Cachedata sombre
Chkcache = false
Cachename = lCase (ChangeChr (cachename)))
Cachedata = application (webcacheflag & cachename)
Si ce n'est pas le cache (cachedata), la fonction de sortie
Si ce n'est pas un isdate (cachedata (1)) puis de la fonction de sortie
Si Datediff (s, cdate (cachedata (1)), maintenant ()) <60 * webcachetime alors chkcache = true
Fonction finale