To use it, just open the index.php file of your PHP-Nuke and enter the following lines, after the line "require_once("mainfile.php");" (that's important!):
require_once("mainfile.php");
if (!isset($user)) {
$cachetimeout=900;
} else {
$cachetimeout=300;
}
require_once "includes/jpcache/jpcache.php";
|
(I have included the 'require_once("mainfile.php");' line in the code above for your orientation).
That's it! You can now tweak the two caching intervalls, 900 and 300 seconds, which apply to non-logged-in and logged-in users respectively. Rethink the questions I asked you in Section 24.1 above. 
A caching intervall of x seconds means that your server will serve you a cached copy of the page, if the cache copy is not older than x seconds. Since non-logged-in users don't get private
messages or similar "events", a longer caching intervall is just right for them. Feel free to experiment with these two values, trading actuality of content against serving speed.
Enjoy your new, lightning fast PHP-Nuke!
Oops...I forgot a crucial detail:
You must edit the mainfile.php file too! There, you *must* comment the line
ob_start("ob_gzhandler");
|
as follows:
# ob_start("ob_gzhandler");
|
Otherwise, you will be compressing twofold, once from PHP-Nuke with the above line and once with jpcache through the configuration line
$JPCACHE_USE_GZIP = 1; // Whether or not to use GZIP
|
of jpcache-config.php.
The other way round, turning off gzip in jpcache and leaving the ob_start("ob_gzhandler") line uncommented in PHP-Nuke, works too. It may even be better to choose this way, if you use Apache and
mod_gzip (a common configuration).
 |
How to test if caching is working |
|
You can check if you are doing it right, by trying to cache a block that just echoes the current time. If the cached block displays the same time again and again after reloading (for some time
interval equal to the "cache interval"), then caching is working!
If it displays the current time (which is changing after every reloading), then caching is NOT working! In this case, most probably no files are being written into the cache directory you
specified. Most of the time, this will be a permissions problem: check that the web server has write and execute permissions on the cache directory! See How to accelerate PHP-Nuke.
|