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
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Cache Fix and load issue?
Maybe check that you're sending no-cache headers instead of hacking around it?
Your method isn't guaranteed to work anyway, since the redirect response can be cached too.

My Blog
03-18-2016 04:10 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: