From 4558117267b1c7fbfa9c35ad2b0047a456dcc08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Tue, 16 Sep 2008 18:18:36 +0000 Subject: Fix the Traffic Graph for Firefox case, which caches agressively and makes the XMLHttpRequest calls return the same result and the output is just a red line at the end of the graph since the difference between the old and new traffic is always 0. --- usr/local/www/graph.php | 6 +++++- usr/local/www/ifstats.php | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'usr') diff --git a/usr/local/www/graph.php b/usr/local/www/graph.php index 1202100..7679423 100755 --- a/usr/local/www/graph.php +++ b/usr/local/www/graph.php @@ -36,7 +36,11 @@ ##|*MATCH=graph.php* ##|-PRIV - +header("Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" ); +header("Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT" ); +header("Cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1 +header("Cache-Control: post-check=0, pre-check=0", FALSE ); +header("Pragma: no-cache"); // HTTP/1.0 header("Content-type: image/svg+xml"); /********** HTTP GET Based Conf ***********/ diff --git a/usr/local/www/ifstats.php b/usr/local/www/ifstats.php index 9ea65ad..e35f35c 100644 --- a/usr/local/www/ifstats.php +++ b/usr/local/www/ifstats.php @@ -65,6 +65,12 @@ } $temp = gettimeofday(); $timing = (double)$temp["sec"] + (double)$temp["usec"] / 1000000.0; + + header("Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" ); + header("Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT" ); + header("Cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1 + header("Cache-Control: post-check=0, pre-check=0", FALSE ); + header("Pragma: no-cache"); // HTTP/1.0 echo "$timing|" . $ifinfo['inbytes'] . "|" . $ifinfo['outbytes'] . "\n"; -- cgit v1.1