X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=http.php;fp=http.php;h=1abd50bc1757abe53f46ef77f95ba4734aa6770a;hb=88edfcf26c7b4cdbd083dede0834de5cf6f16999;hp=b82e3d1dff7f44a705645552767510a3bef7198a;hpb=48bc8c7ca2448555a225b5996effcc9d41bdcfed;p=wfpl.git diff --git a/http.php b/http.php index b82e3d1..1abd50b 100644 --- a/http.php +++ b/http.php @@ -92,4 +92,11 @@ function redirect($url, $status = '302 Moved Temporarily', $message = '') { exit(); } +# output http headers to allow caching of this page forever +function http_cache_forever($cache_control = 'public') { + header('Last-Modified: '.gmdate('D, d M Y H:i:s', 5025) . ' GMT'); # long time ago + header("Cache-Control: $cache_control"); + header('Expires: ' . gmdate('D, d M Y H:i:s',time()+31536000) . ' GMT'); # rfc 2616 says not to go more than a year in the future +} + ?>