Skip to content

Instantly share code, notes, and snippets.

@xombra
Created April 26, 2014 02:30
Show Gist options
  • Save xombra/11310260 to your computer and use it in GitHub Desktop.
Save xombra/11310260 to your computer and use it in GitHub Desktop.
Preparar el HEADER de una página
function HEADERS($lenguaje,$charset){
global $ExpStr;
header('Accept-Ranges: bytes');
$tiempo = $_SERVER['REQUEST_TIME'] + 18144000;
$ExpStr = 'Expires: '.gmdate("D, d M Y H:i:s", $tiempo) . " GMT";
session_cache_limiter('private_no_expire');
session_cache_expire(115200);
header($ExpStr);
header("Content-Language:$lenguaje");
header("Cache-Control: cache");
header("Pragma: cache");
header("Pragma: public");
header("Cache-Control: public, max-age=$tiempo , pre-check=$tiempo, post-check=$tiempo");
header("Content-Transfer-Encoding:gzip;q=1.0, identity; q=0.5, *;q=0");
header("Content-Type: text/html; charset=$charset");
$etag = md5($_SERVER['REQUEST_URI'] . $ExpStr);
header("Etag: $etag");
return $ExpStr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment