Boost logo

Boost :

From: Janusz Piwowarski (jpiw_at_[hidden])
Date: 2005-11-10 03:03:37


Rene Rivera wrote:
> Thanks... Tried it but unfortunately it seems the version of Apache
> that SF uses doesn't understand the Expires* directives.

It requires mod_expires enabled. But if SF supports PHP, you can use script
below:

<?php
// open the file in a binary mode
$fp = fopen($QUERY_STRING, "rb");

// send the right headers
$ext = substring($QUERY_STRING, strrpos($QUERY_STRING, ".") + 1);
if ($ext = "jpg") $ext = "jpeg";

header("Content-Type: image/" . $ext);
header("Content-Length: " . filesize($QUERY_STRING));
header("Expires: " . date("r", time() + (30 * 24 * 60 * 60)));

// dump the picture and stop the script
fpassthru($fp);
fclose($fp);
exit;
?>

and modify background images in CSS, e.g.:

  background: url(addexpires.php?menu_link_indicator.png) no-repeat left
center;

where addexpires.php is above script name.

You can see it works at http://bielsko-biala.org/boost

-- 
Regards,
Janusz 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk