changeset 2457:d26623bd65e0

Removed browser caching for PHP servers
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 02 Aug 2016 11:22:51 +0100
parents 17688ed74bed
children 7875d043f8ba 221688a8be4f
files php/comment_parser.php php/get_filtered_count.php php/get_filtered_score.php php/get_tests.php php/keygen.php php/pool.php php/pseudo.php php/save.php php/score_parser.php
diffstat 9 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/php/comment_parser.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/comment_parser.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,5 +1,8 @@
 <?php
 // Comment Parser for PHP
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 class audioElement {
     function __construct($id) {
         $this->id = $id;
--- a/php/get_filtered_count.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/get_filtered_count.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 //http://stackoverflow.com/questions/4444475/transfrom-relative-path-into-absolute-url-using-php
 include "rel2abs.php";
 
--- a/php/get_filtered_score.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/get_filtered_score.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 class nestedObject {
     function __construct($id) {
         $this->id = $id;
--- a/php/get_tests.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/get_tests.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 /*
     Get Tests
     
--- a/php/keygen.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/keygen.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 // This checks the key sent by the JavaScript against the current bunch of saves
 // XML Saves location - assumes it will be saves/
 $saves = glob("../saves/*.xml");
--- a/php/pool.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/pool.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 // This works out the pool of pages to force the browser to use from the master pool set by 'modifying' the XML file
 //
 
--- a/php/pseudo.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/pseudo.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,6 +1,9 @@
 <?php
     header('Access-Control-Allow-Origin: *');
 	header("Content-type: text/xml");
+    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+    header("Cache-Control: post-check=0, pre-check=0", false);
+    header("Pragma: no-cache");
     $files = glob('../saves/' . '*.xml');
     $numsaves = 0;
     if ( $files !== false )
@@ -18,4 +21,4 @@
     $testID = ($numsaves % $numtests);
 
 	readfile($files[$testID]);
-?>
\ No newline at end of file
+?>
--- a/php/save.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/save.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+    header("Cache-Control: post-check=0, pre-check=0", false);
+    header("Pragma: no-cache");
 	error_reporting(0);
 	$saveFilenamePrefix = isset($_GET['saveFilenamePrefix']) ? $_GET['saveFilenamePrefix'].'-' : '';
 	header('Access-Control-Allow-Origin: *');
--- a/php/score_parser.php	Tue Aug 02 11:52:02 2016 +0200
+++ b/php/score_parser.php	Tue Aug 02 11:22:51 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 // Value parser for WAET XML
 // testPage --> axis --> element --> value
 class nestedObject {