![Netscape ENTERPRISE SERVER 6.1 Скачать руководство пользователя страница 339](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653339.webp)
Appendix
F
Dynamic Results Caching Functions
339
dr_cache_init
The
dr_cache_init
function creates a persistent handle to the cache, or NULL on
failure. It is called by an
Init
SAF.
Syntax
PRInt32 dr_cache_init(DrHdl *hdl, RefreshFunc_t ref, FreeFunc_t fre,
CompareFunc_t cmp, PRUint32 maxEntries, PRIntervalTime maxAge);
Returns
1
if successful.
0
if an error occurs.
Parameters
DrHdl hdl
is a pointer to an unallocated handle.
RefreshFunc_t ref
is a pointer to a cache refresh function. This can be NULL; see
the
DR_CHECK
flag and
DR_EXPIR
return value for
dr_net_write
.
FreeFunc_t fre
is a pointer to a function that frees an entry.
CompareFunc_t cmp
is is a pointer to a key comparator function.
PRUint32 maxEntriesp
is the maximum number of entries possible in the cache
for a given
hdl
.
PRIntervalTime maxAgep
is the maximum amount of time that an entry is valid. If
0
, the cache never expires.
Example
if(!dr_cache_init(&hdl, (RefreshFunc_t)FnRefresh,
(FreeFunc_t)FnFree, (CompareFunc_t)FnCompare, 150000,
PR_SecondsToInterval(7200)))
{
ereport(LOG_FAILURE, "dr_cache_init() failed");
return(REQ_ABORTED);
}
dr_cache_refresh
The
dr_cache_refresh
function provides a way of refreshing a cache entry when
the plugin requires it. This can be achieved by passing NULL for the
ref
parameter
in
dr_cache_init
and by passing
DR_CHECK
in a
dr_net_write
call. If
DR_CHECK
is
passed to
dr_net_write
and it returns with
DR_EXPIR
, the plugin should generate
a new content in the entry and call
dr_cache_refresh
with that entry before
calling
dr_net_write
again to send the response.
Содержание ENTERPRISE SERVER 6.1
Страница 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Страница 18: ...Where to Find Related Information 18 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 138: ...CGI to NSAPI Conversion 138 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 214: ...NSAPI Functions in Alphabetical Order 214 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 310: ...The Netscape LDAP Schema 310 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 324: ...Sample MIME Types File 324 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...