Name: Padraic Renaghan
Member since: 1999-11-23 22:56:24
Last Login: N/A
Homepage: http://www.renaghan.com/pcr/
function pageCacheStart($ttl=600, $debug=FALSE,
$cacheDir='/tmp/pagecache', $sidName='psid') {
global $HTTP_SERVER_VARS, $HTTP_GET_VARS,
$HTTP_COOKIE_VARS;
//to force the cache OFF, uncomment next line
//return FALSE;
// we only use the cache for GET requests.
// we don't use the cache for ssl requests.
if ($HTTP_SERVER_VARS['REQUEST_METHOD']!='GET'
|| isset($HTTP_SERVER_VARS['HTTPS']) ) {
return FALSE;
}
$REQUEST_URI = $HTTP_SERVER_VARS['REQUEST_URI'];
// if we have the sid in the get vars,
// and we have the sid in the cookie vars,
// then we can act as if the sid is not in the get
// vars and return a cached page.
// if the sid is in the get, and not as a cookie,
// then we don't use a cached version since all the URLs
// in the page need to be rewritten with the sid by php.
if (isset($HTTP_GET_VARS[$sidName])) {
if (isset($HTTP_COOKIE_VARS[$sidName])) {
if (count($HTTP_GET_VARS)==1) {
$REQUEST_URI = $HTTP_SERVER_VARS['SCRIPT_NAME'];
} else {
$REQUEST_URI =
ereg_replace('&'.$sidName.'=.{32}','',$REQUEST_URI);
}
} else {
return FALSE;
}
}
// get the hostname
if (isset($HTTP_SERVER_VARS['HTTP_HOST'])) {
$HOST = $HTTP_SERVER_VARS['HTTP_HOST'];
} else {
$HOST = $HTTP_SERVER_VARS['SERVER_NAME'];
}
// cache directory use for pages from this host.
$cacheDirHost = $cacheDir.'/'.strtolower($HOST);
// build the name of the cache file for this page
$cacheFile = $cacheDirHost.'/'.md5($REQUEST_URI).'.cache';
$mtime = filemtime($cacheFile);
$time = time();
if ($mtime >= ($time - $ttl)) {
//send cache control headers that let client browser
//cache the page.
header('Expires: '.gmdate('D, d M Y H:i:s', $time +
$ttl).' GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s',
$mtime).' GMT');
header('Cache-Control: public');
header('Cache-Control: max-age='.$ttl);
//get the cached file and send it to the browser
immediately
readfile($cacheFile);
//debug info
if ($debug) {
print("<hr>CACHED COPY
filename: $cacheFile\n");
print("
mtime: ".date('m/d/y h:i:s
a',filemtime($cacheFile))."\n");
print("
cache age
".(time()-filemtime($cacheFile))." seconds\n");
}
//exit this server session
exit();
} else {
// the directory existence is the signal that pages
// from this host should be cached.
if (!is_dir($cacheDirHost)) {
return FALSE;
}
ob_start();
print("<!-- request: ".$HOST.$REQUEST_URI." -->\n");
return $cacheFile;
}
}
function pageCacheEnd($cacheFile='', $debug=FALSE) {
$html = ob_get_contents();
ob_end_flush();
if (empty($cacheFile)) {
} else {
if ($debug) {
print("<hr>writing new cacheFile: $cacheFile\n");
}
if ($fp = @fopen ($cacheFile, 'w')) {
@fwrite ($fp, $html);
@fclose ($fp);
}
}
}
Setup with Windows 95 was relatively easy, though as Mobile Computing points out, Lucent doesn't make the configuration for a bridge setup known - in fact, they don't really even mention it. You are left to your own devices to figure out how to setup DHCP, NAT and such to achieve the bridge config.
I got it working on Windows, then rebooted the laptop to RH 7. After figuring out the mutliple drivers that can run these cards, and a little trial and error with modules.conf, config.opts, and wireless.opts I got it all up and running.
Speed it great - as fast as a wired connection in my environment. Range seems to be good, at least I can go up and downstairs and in all corners of my small 2 bedroom apartment.
Much thanks to Jean Tourrilhes for his vast Wireless LAN resources for Linux site.
Right now APC is crapping out on the crazy levels of class hierarchy scattered among 70+ include files that I use for my PHP Ecommerce application, VendoToSell.
Who needs Real Pukebox Plus? Not moi. Lame VBR 256 kbps encoding for free.
prenagha certified others as follows:
Others have certified prenagha as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!