Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
48bc8c7
)
added http_cache_forever()
author
Jason Woofenden
<jason283@herkamire.com>
Thu, 12 Mar 2009 01:25:21 +0000
(21:25 -0400)
committer
Jason Woofenden
<jason283@herkamire.com>
Thu, 12 Mar 2009 01:25:21 +0000
(21:25 -0400)
http.php
patch
|
blob
|
history
diff --git
a/http.php
b/http.php
index
b82e3d1
..
1abd50b
100644
(file)
--- 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
+}
+
?>