![Netscape ENTERPRISE SERVER 6.1 Manual Download Page 341](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653341.webp)
Appendix
F
Dynamic Results Caching Functions
341
By default, this function refreshes the cache entry if it has expired by making a call
to the
ref
function passed to
dr_cache_init
. If no cache entry is found with the
specified
key
, this function adds a new cache entry by calling the
ref
function
before sending out the response. However if the
DR_CHECK
flag is passed in the
flags
parameter and if either the cache entry has expired or the cache entry
corresponding to the
key
does not exist,
dr_net_write
does not send any data out.
Instead it returns with
DR_EXPIR
.
If
ref
(passed to
dr_cache_init
) is NULL, the DR_CHECK flag is not passed in
the
flags
parameter, and the cache entry corresponding to the
key
has expired or
does not exist,
dr_net_write
fails with
DR_ERROR
. However,
dr_net_write
refreshes the cache if
ref
is not NULL and
DR_CHECK
is not passed.
If
ref
(passed to
dr_cache_init
) is NULL and the
DR_CHECK
flag is not passed but
DR_IGNORE
is passed and the entry is present in the cache,
dr_net_write
sends out
the response even if the entry has expired. However, if the entry is not found,
dr_net_write
returns
DR_ERROR
.
If
ref
(passed to
dr_cache_init
) is not NULL and the
DR_CHECK
flag is not passed
but
DR_IGNORE
is passed and the entry is present in the cache,
dr_net_write
sends
out the response even if the entry has expired. However, if the entry is not found,
dr_net_write
calls the
ref
function and stores the new entry returned from
ref
before sending out the response.
Syntax
PRInt32 dr_net_write(DrHdl hdl, const char *key, PRUint32 klen,
const char *hdr, const char *ftr, PRUint32 hlen, PRUint32 flen,
PRIntervalTime timeout, PRUint32 flags, Request *rq, Session *sn);
Returns
IO_OKAY
if successful.
IO_ERROR
if an error occurs.
DR_ERROR
if an error in cache handling occurs.
DR_EXPIR
if the cache has expired.
Parameters
DrHdl hdl
is a persistent handle created by the
dr_cache_init
function.
const char *key
is the key to cache, search, or refresh.
PRUint32 klen
is the length of the key in bytes.
const char *hdr
is any header data (which can be NULL).
const char *ftr
is any footer data (which can be NULL).
Summary of Contents for ENTERPRISE SERVER 6.1
Page 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Page 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...