set http meta cache time using php

by Prakash 2013-12-10 17:17:26

Put the following code in the header to set http meta cache time using php


$seconds_to_cache = 120;
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header("Expires: $ts");
header("Pragma: cache");
header("Cache-Control: max-age=$seconds_to_cache");
1010
like
0
dislike
0
mail
flag

You must LOGIN to add comments