summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-03-02 12:34:34 +0100
committerAndrew Dolgov <[email protected]>2007-03-02 12:34:34 +0100
commitdc56b3b7dac5b3ac757c10971e10aa7a1f09ea47 (patch)
tree59870f6c818a30afa37f2887838451387a971a38
parentf7c390b8787fbf5cf0fbc3cb8c1396454edb7b28 (diff)
no-cache fixes for safari
-rw-r--r--backend.php9
-rw-r--r--functions.php9
-rw-r--r--prefs.php4
-rw-r--r--tt-rss.php4
4 files changed, 15 insertions, 11 deletions
diff --git a/backend.php b/backend.php
index 656dcbf9c..b1ddcd5af 100644
--- a/backend.php
+++ b/backend.php
@@ -1,11 +1,8 @@
<?php
require_once "sessions.php";
require_once "modules/backend-rpc.php";
-
- header("Cache-Control: no-cache, max-age=0, must-revalidate");
- header("Pragma: no-cache");
- header("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
-
+
+
/* if ($_GET["debug"]) {
define('DEFAULT_ERROR_LEVEL', E_ALL);
} else {
@@ -23,6 +20,8 @@
require_once "db-prefs.php";
require_once "functions.php";
+ no_cache_incantation();
+
$script_started = getmicrotime();
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
diff --git a/functions.php b/functions.php
index 49955b63f..f014b8d29 100644
--- a/functions.php
+++ b/functions.php
@@ -3162,4 +3162,13 @@
require_once "login_form.php";
}
+ // from http://developer.apple.com/internet/safari/faq.html
+ function no_cache_incantation() {
+ header("Expires: Mon, 22 Dec 1980 00:00:00 GMT"); // Happy birthday to me :)
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
+ header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1
+ header("Cache-Control: post-check=0, pre-check=0", false);
+ header("Pragma: no-cache"); // HTTP/1.0
+ }
+
?>
diff --git a/prefs.php b/prefs.php
index ad77d8662..93c246b90 100644
--- a/prefs.php
+++ b/prefs.php
@@ -12,9 +12,7 @@
$dt_add = get_script_dt_add();
- header("Cache-Control: no-cache, max-age=0, must-revalidate");
- header("Pragma: no-cache");
- header("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
+ no_cache_incantation();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
diff --git a/tt-rss.php b/tt-rss.php
index ab850f2f4..bc337ee31 100644
--- a/tt-rss.php
+++ b/tt-rss.php
@@ -12,9 +12,7 @@
$dt_add = get_script_dt_add();
- header("Cache-Control: no-cache, max-age=0, must-revalidate");
- header("Pragma: no-cache");
- header("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
+ no_cache_incantation();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"