require_once ("./inc/db/mysql.php");
require_once ("./inc/utils.php");
-header ("Content-type: application/atom+xml; charset=UTF-8");
-header("Cache-control: no-cache");
+function headers_callback ($output) {
+ $etag = md5 ($output);
+ if ((isset ($_SERVER ["HTTP_IF_NONE_MATCH"])) &&
+ ($_SERVER ["HTTP_IF_NONE_MATCH"] == $etag)) {
+ header ("HTTP/1.1 304 Not Modified");
+ exit ();
+ }
+
+ header ("Content-type: application/atom+xml; charset=UTF-8");
+ header ("Cache-control: must-revalidate");
+ header (sprintf ("ETag: %s", $etag));
+
+ return $output;
+}
function date3339 ($feature) {
$date = date ('Y-m-d\TH:i:s', $feature->date);
} catch (Exception $e) {
exit ("server error");
}
+
+ob_start ("headers_callback");
main ($features);
+ob_end_flush ()
?>