Cache Fix and load issue?
devnet Offline
Junior Member
**
Posts: 5
Joined: Feb 2016
Post: #1
Cache Fix and load issue?
Hello , I use them cloudflare + free SSL, and I want to add a mod to fix a cache, but passing time while redirections . Does anyone know how to do that work directly with https and port 443?:


function getCurPageURL() {
$pageURL = 'http';
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}

function FixCacheAction(){
global $mybb;
if($mybb->input["rndtime"]=="" && $_SERVER['REQUEST_METHOD'] != 'POST'){
$url=getCurPageURL();
if(strpos($url,"?")===false)
$url=$url."?rndtime=".TIME_NOW.rand();
else
$url=$url."&rndtime=".TIME_NOW.rand();
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: ".$url);
exit(0);
}
}
03-17-2016 01:12 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Cache Fix and load issue? - devnet - 03-17-2016 01:12 PM

 Standard Tools
Forum Jump: