| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="6UnderstandingtheJpGraphcachingsystem.html">
|
|
|
8 |
<LINK REL="Next" HREF="62Usingthecacheinyourscript.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="6UnderstandingtheJpGraphcachingsystem.html">Previous</A>
|
|
|
26 |
<A HREF="62Usingthecacheinyourscript.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="6_1">6.1 Enabling the cache system</A></H2>
|
|
|
29 |
<P> The enabling disabling of the cache system is controlled by two
|
|
|
30 |
defines (in jpg-config.php)</P>
|
|
|
31 |
<P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
32 |
DEFINE</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
33 |
"USE_CACHE"</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
34 |
true</FONT><FONT color="#007700">);
|
|
|
35 |
<BR></FONT><FONT color="#0000BB">DEFINE</FONT><FONT color="#007700">(</FONT><FONT
|
|
|
36 |
color="#DD0000">"READ_CACHE"</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
37 |
true</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT></FONT>
|
|
|
38 |
</CODE></DIV></P>
|
|
|
39 |
<P></P>
|
|
|
40 |
<P> The first of these, USE_CACHE, is the master-switch which must be
|
|
|
41 |
set to true to enable the caching system. The second switch READ_CACHE
|
|
|
42 |
very seldom needs to be changed.</P>
|
|
|
43 |
<P> This second switch basically tells whether or not JpGraph should
|
|
|
44 |
ever look in the cache. Setting this to false and the master-switch to
|
|
|
45 |
true would then always generate an new updated image file in the cache
|
|
|
46 |
and this new image would be send back to the browser. The main use for
|
|
|
47 |
this (admittedly) strange setting is if you like to have the side
|
|
|
48 |
effect of the script that a fresh image is always stored in the cache
|
|
|
49 |
directory.</P>
|
|
|
50 |
<P> Once you have enabled the cache you must also make sure that a valid
|
|
|
51 |
cache directory is setup. The cache directory is specified with the
|
|
|
52 |
define</P>
|
|
|
53 |
<P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
54 |
DEFINE</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
55 |
"CACHE_DIR"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
56 |
"/tmp/jpgraph_cache/"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB">
|
|
|
57 |
</FONT></FONT></CODE></DIV></P>
|
|
|
58 |
<P></P>
|
|
|
59 |
<P> You can of course change the default directory to whatever directory
|
|
|
60 |
you fancy. But, you must remember one important thing.<STRONG> The
|
|
|
61 |
cache directory must be writable for the user running Apache/PHP</STRONG>
|
|
|
62 |
.</P>
|
|
|
63 |
<HR NOSHADE>
|
|
|
64 |
<A HREF="toc.html">Contents</A>
|
|
|
65 |
<A HREF="6UnderstandingtheJpGraphcachingsystem.html">Previous</A>
|
|
|
66 |
<A HREF="62Usingthecacheinyourscript.html">Next</A>
|
|
|
67 |
</BODY>
|
|
|
68 |
</HTML>
|