Annotation of libwww/Library/src/HTCache.html, revision 2.3
2.1 frystyk 1: <HTML>
2: <HEAD>
2.2 frystyk 3: <TITLE>Disk Cache Manager</TITLE>
4: <!-- Changed by: Henrik Frystyk Nielsen, 16-Aug-1995 -->
2.1 frystyk 5: <NEXTID N="z4">
6: </HEAD>
7: <BODY>
8:
2.2 frystyk 9: <H1>Disk Cache Manager</H1>
2.1 frystyk 10:
11: <PRE>
12: /*
13: ** (c) COPYRIGHT MIT 1995.
14: ** Please first read the full copyright statement in the file COPYRIGH.
15: */
16: </PRE>
17:
18: The cache contains details of temporary disk files which contain the
19: contents of remote documents. There is also a <A
20: HREF="HTAnchor.html#z1">list of cache items for each URL</A> in its
21: anchor object. <P>
22:
23: This module is implemented by <A HREF="HTCache.c">HTCache.c</A>, and
24: it is a part of the <A
2.3 ! frystyk 25: HREF="http://www.w3.org/pub/WWW/Library/">W3C Reference
2.1 frystyk 26: Library</A>.
27:
28: <PRE>
29: #ifndef HTCACHE_H
30: #define HTCACHE_H
31:
32: #include "HTStream.h"
33: #include "HTAnchor.h"
34: #include "HTFormat.h"
35: </PRE>
36:
37: <H2>Converters</H2>
38:
39: The cache stream is in fact a stream that can be registered as a converter!
40:
41: <PRE>
42: #ifndef pyramid
43: extern HTConverter HTCacheWriter;
44: #endif
45: </PRE>
46:
2.2 frystyk 47: <H2>Find a Reference for a Cached Object</H2>
2.1 frystyk 48:
2.2 frystyk 49: Verifies if a cache object exists for this URL and if so returns a URL
50: for the cached object. It does not verify whether the object is valid
51: or not, for example it might have been expired.
2.1 frystyk 52:
53: <PRE>
2.2 frystyk 54: extern char * HTCache_getReference PARAMS((char * url));
55: </PRE>
56:
57: <H2>Verify if an Object is Valid</H2>
58:
59: This function checks whether a document has expired or not. The check
60: is based on the metainformation passed in the anchor object The
61: function returns YES or NO.
62:
63: <PRE>
64: extern BOOL HTCache_isValid PARAMS((HTParentAnchor * anchor));
2.1 frystyk 65: </PRE>
66:
67: <H2>Enable Cache</H2>
68:
69: If <EM>cache_root</EM> is NULL then reuse old value or use
70: <CODE>HT_CACHE_ROOT</CODE>. An empty string will make '/' as cache
71: root.
72:
73: <PRE>
2.2 frystyk 74: extern BOOL HTCache_enable PARAMS((CONST char * cache_root));
2.1 frystyk 75: </PRE>
76:
77: <H2>Disable Cache</H2>
78:
79: Turns off the cache. Note that the cache can be disabled and enabled
80: at any time. The cache root is kept and can be reused during the
81: execution.
82:
83: <PRE>
2.2 frystyk 84: extern BOOL HTCache_disable NOPARAMS;
2.1 frystyk 85: </PRE>
86:
87: <H2>Is Cache Enabled</H2>
88:
89: Returns YES or NO. Also makes sure that we have a root value (even
90: though it might be invalid)
91:
92: <PRE>
2.2 frystyk 93: extern BOOL HTCache_isEnabled NOPARAMS;
2.1 frystyk 94: </PRE>
95:
96: <H2>Set Cache Root</H2>
97:
98: If <EM>cache_root</EM> is NULL then the current value (might be a define)
99: Should we check if the cache_root is actually OK? I think not!
100:
101: <PRE>
2.2 frystyk 102: extern BOOL HTCache_setRoot PARAMS((CONST char * cache_root));
2.1 frystyk 103: </PRE>
104:
105: <H2>Get Cache Root</H2>
106:
107: <PRE>
2.2 frystyk 108: extern CONST char *HTCache_getRoot NOPARAMS;
2.1 frystyk 109: </PRE>
110:
2.2 frystyk 111: <H2>Clean up memory</H2>
2.1 frystyk 112:
113: This is done by the Library function <A
2.2 frystyk 114: HREF="HTAccess.html#Library">HTLibTerminate()</A>. None of these
115: functions tourches the disk cache itself - they only manages memory.
2.1 frystyk 116:
117: <PRE>
2.2 frystyk 118: extern void HTCache_freeRoot NOPARAMS;
119: extern void HTCache_clearMem NOPARAMS;
2.1 frystyk 120: </PRE>
121:
2.2 frystyk 122: <H2>To remove All cache files known to this session</H2>
2.1 frystyk 123:
2.2 frystyk 124: This function also cleans the entries on disk
2.1 frystyk 125:
126: <PRE>
2.2 frystyk 127: extern void HTCache_deleteAll NOPARAMS;
2.1 frystyk 128:
129: #endif
130: </PRE>
131:
132: End of declaration module
133: </BODY>
134: </HTML>
Webmaster