(or some other value in seconds)
I would also recommend changing it so the there isnt a question mark
in the url, as some (admittedly old now!) browers wont cache urls with
? in.
Ideally you would also use the last modified header and return 304's
if not changed. I dont have python code to hand but this is working
php code:
$gmdate_mod = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
$if_modified_since = preg_replace('/;.*$/', '',
$_SERVER['HTTP_IF_MODIFIED_SINCE']);
if ($if_modified_since == $gmdate_mod) {
header("HTTP/1.0 304 Not Modified");
header('Content-Length: 0');
exit;
}
}
header("Last-Modified: $gmdate_mod");
get $mtime from the time the user uploaded the image (hopefully you
stored that in the datastore!) and insert this login inbetween
fetching the image (to get the date) and actully returning it.
--
Barry
(paste the url of a page, or just the image)
--