From 7075c0b8519cc6b3c8e4a53dddf78f7ded598456 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 1 Oct 2014 00:43:34 +0200 Subject: cache buster, more glyphicons, improved caching --- index.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 8c94c91..268f0f2 100644 --- a/index.php +++ b/index.php @@ -5,6 +5,9 @@ ob_start('minify'); session_name(SESSION); session_start(); +if ( ! isset($cache) ) + $cache = true; + $c = new cache(REDIS_CONNECT, REDIS_DB); if ( isset($_SESSION["loggedin"]) && $_SESSION["loggedin"]){ @@ -13,7 +16,7 @@ if ( isset($_SESSION["loggedin"]) && $_SESSION["loggedin"]){ $a = "0_"; } -if ( $_SERVER["REQUEST_METHOD"] == "GET" && $_SERVER["REDIRECT_STATUS"] == 200 && strpos($_SERVER["QUERY_STRING"], "account") === false && strpos($_SERVER["QUERY_STRING"], "logout") === false && strpos($_SERVER["QUERY_STRING"], "action") === false) { +if ( $cache && $_SERVER["REQUEST_METHOD"] == "GET" && $_SERVER["REDIRECT_STATUS"] == 200 ) { $token = $c->getToken($_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]. $_SERVER["QUERY_STRING"], $a); if ( $c->exists($token)){ header("X-Cache: Hit"); @@ -42,7 +45,7 @@ $user = new jg($u); // echo " + .dl-horizontal dt{white-space: normal;}.btn-info{background-color:#3083D6;border-color:#357ebd}.btn-primary{background-color:#3083D6;}.img-responsive{margin:0 auto;}@-moz-document url-prefix(){fieldset{display:table-cell;}}ul.nav li.dropdown:hover ul.dropdown-menu {display:block;}.video{max-width:720px;margin-right: auto;margin-left: auto;}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active{background-color:#3071a9}