Cache
P
rint
C
lose
documented with
GabLibrary Documentor.
(4/6/2007 7:42:14 PM)
Class Cache
^
Lets you cache values, objects, etc. It uses the application-variables and therefore the cache will be shared with all other users. it can cash items which are identified by an Identifier. The cache will be identified by its name The cache is protected against memory problems. e.g. huge contents wont be cached, cache has a limited size. so that the server is not to busy you can define how the caching works for a specific thing. e.g. you want to cache RSS Feeds then you can setup that the cache for RSS will hold a maximum of 10 RSS feeds shared. The organisation of the cache is done automatically if the maximum amount of items is reached
Version:
0.1
Author:
Michal Gabrukiewicz on 2006-11-10 15:46
Last modified:
02.03.2007 19:22:48
Path:
/gab_Library/class_cache/cache.asp
Demo:
/gab_Library/class_cache/demo/
Properties
^
Name
Type
Description
interval
string
what interval is used to define the expiration of the items. default = h (hour) allowed values are all values which can be used with dateadd() function. e.g. m = month, etc.
intervalValue
string
which value of the interval. default = 1
maxItemSize
string
the maximum size in bytes of an item which will be cached. all items with a size bigger than this value wont be cached (saving memory on the server). default = 100000 works only if the items are no objects and no arrays
maxSlots
string
the maximum amount of slots for caching items. default = 10
name
string
name of the cache you want to create. normally a word which describes what it is caching
Methods
^
clear ( )
clears the cache.
getItem ( identifier )
gets an item from the cache.
identifier
(
string
)
: identifier of the item within the cache
Return
(
variant
) : empty if no value found, otherwise the value.
store ( identifier item )
stores an item into the cache. if it already exists then it gets overwritten
identifier
(
string
)
: the identifier for the item. with this you can get the item afterwards
item
(
variant
)
: something you want to store within the cache. Note: Objects does not work!!