ソースを参照

Explicitly disable caching for left_main and right_main pages (#2983134)

jangliss 15 年 前
コミット
360e86143a
3 ファイル変更11 行追加3 行削除
  1. 1 0
      doc/ChangeLog
  2. 6 3
      src/left_main.php
  3. 4 0
      src/right_main.php

+ 1 - 0
doc/ChangeLog

@@ -337,6 +337,7 @@ Version 1.5.2 - SVN
     leakage when Firefox does DNS prefetching for URLs contained in emails.
   - Added the ability to configure Google Mail (Gmail) as the mail server
     behind SquirrelMail.
+  - Explicitly disable caching for left_main and right_main pages (#2983134).
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------

+ 6 - 3
src/left_main.php

@@ -15,6 +15,11 @@
 /** This is the left_main page */
 define('PAGE_NAME', 'left_main');
 
+/* Disable browser caching */
+header('Cache-Control: no-cache, no-store, must-revalidate');
+header('Pragma: no-cache');
+header('Expires: ' . gmdate(DATE_RFC1123, time()-1));
+
 /**
  * Include the SquirrelMail initialization file.
  */
@@ -45,9 +50,7 @@ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort,
  */
 if (!empty($left_refresh) &&
     !stristr($left_refresh, 'none')){
-    $xtra =  "\n<meta http-equiv=\"Expires\" content=\"Thu, 01 Dec 1994 16:00:00 GMT\" />\n" .
-             "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n".
-             "<meta http-equiv=\"REFRESH\" content=\"$left_refresh;URL=left_main.php\" />\n";
+    $xtra =  "\n<meta http-equiv=\"REFRESH\" content=\"$left_refresh;URL=left_main.php\" />\n";
 } else {
     $xtra = '';
 }

+ 4 - 0
src/right_main.php

@@ -17,6 +17,10 @@ define('PAGE_NAME', 'right_main');
 
 //xdebug_start_profiling("/var/spool/xdebug/right_main.txt");
 
+/* Disable browser caching */
+header('Cache-Control: no-cache, no-store, must-revalidate');
+header('Pragma: no-cache');
+header('Expires: ' . gmdate(DATE_RFC1123, time()-1));
 
 /**
  * Include the SquirrelMail initialization file.