Is there a way to run a cron every 90 minutes? If my cron line is something like:
*/90 * * * *
It runs every 60 minutes. It seems like the minute counter won't let it go above 60. But then how can I run something every hour and a half (or two hours and a half), or every 72 minutes or something?
I changed the caching on my entire site, so, this is here so I can leave comments to make sure everything's hunky dory.
In the spirit of Simon's, I created my own conditional get function. My RSS feed finally does conditional get 
<?php
function httpConditionalGet($timestamp, $is_timestamp = true){
if($is_timestamp) $last_modified = gmdate('r', $timestamp);
if((isset($_SERVER['HTTP_IF_NONE_MATCH']) and $_SERVER['HTTP_IF_NONE_MATCH'] == $timestamp) or
($is_timestamp and
isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) and
$_SERVER['HTTP_IF_MODIFIED_SINCE'] == $last_modified)
){
header('HTTP/1.1 304 Not Modified');
exit;
}
if($is_timestamp) header("Last-modified: $last_modified");
header('ETag: '.($is_timestamp ? $timestamp : md5($timestamp)));
}
?>
So, you can pass it a timestamp and it'll use Last-modified headers, but if you explicitly tell it it's not a timestamp then it won't and will just use an ETag instead.
Update (5/7): Note that this code is kind of broken. It was just a quick hack that worked for me, but I didn't test it well because I was (and still am) in the middle of finals. Once I get a chance I'll revise it and fix what's broken. Thanks to Bob Congdon for pointing me to what I did wrong. I explain some of the things in the comments on his post about this.
Update (12/11): I figured I'd post the updated, correct version of this code:
<?php
function httpConditionalGet($thing, $is_timestamp = true){
#thing can be either a timestamp or anything else you want to serve as an etag
#if it's not a timestamp, it's the caller's responsibility to md5 it or whatever
if($is_timestamp) header('Last-modified: '.($lm = gmdate('r', $thing)));
header('ETag: "'.$thing.'"');
$client_etag = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? $_SERVER['HTTP_IF_NONE_MATCH'] : NULL;
$client_lm = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : NULL;
if(($client_etag and $client_etag == '"'.$thing.'"') #etag
or
($is_timestamp and $client_lm and ($client_lm == $lm or $thing == strtotime($client_lm))) #last-modified
) header('HTTP/1.1 304 Not Modified') and exit;
}
?>
It looks much better when it's not word-wrapped.
new⇒I hate PHP
Elliot Anderson,
Dude!! You theman! The reverse replacement forarray_u...
Alex Ndungu: Oct 11, 1:35am