this is my method to do things
after uploading files and making correct jpcache path things
i do this for the each files i want to cache (index.php viewforum.php viewtopic.php even search.php and userlist.php)
after require PUN_ROOT.'include/common.php';
if ($pun_user['is_guest']) {
$cachetimeout=86400;
} else {
$cachetimeout=-1;
}
require_once("include/jpcache/jpcache.php");
and my header.php is (only the header part)
if ($pun_user['is_guest']) {
// Send no-cache headers
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // For HTTP/1.0 compability
}
else if (!$pun_user['is_guest']) {
header("Date: ".gmdate("D, d M Y H:i:s", time())." GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s", time())." GMT");;
header("Expires: ".gmdate("D, d M Y H:i:s", time() + 5)." GMT");
header("Cache-Control: public,must-revalidate,max-age=5");
$if_modified_since = preg_replace('/;.*$/', '', $HTTP_IF_MODIFIED_SINCE);
$mtime = time() + 5;
$gmdate_mod = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
if ($if_modified_since == $gmdate_mod) {
header("HTTP/1.0 304 Not Modified");
exit;
}
//header("Last-Modified: $gmdate_mod");
}
oh one more thing i am not gzip ing pages from punbb options i did it from .htaccess
i am not sure if this works if i gzip from punbb options.
Last edited by gorsan (2009-03-01 00:06:37)