diff options
author | Evan Prodromou <evan@status.net> | 2010-08-31 00:33:56 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-09-02 22:26:19 -0400 |
commit | c8a69f433c8839280378551ac11290f1c8a2182e (patch) | |
tree | 7e7067f7f60e97026e3e942fc968851a75bd3873 /lib/action.php | |
parent | 0c5ca46ba3a070803d993b0244fcc69d33875ebd (diff) |
add some caching headers
Diffstat (limited to 'lib/action.php')
-rw-r--r-- | lib/action.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/action.php b/lib/action.php index 0b1cef365..31ae49881 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1004,10 +1004,30 @@ class Action extends HTMLOutputter // lawsuit } } } + + if ($this->isCacheable()) { + header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' ); + header( "Cache-Control: private, must-revalidate, max-age=0" ); + } } } /** + * Is this action cacheable? + * + * If the action returns a last-modified + * + * @param array $argarray is ignored since it's now passed in in prepare() + * + * @return boolean is read only action? + */ + + function isCacheable() + { + return true; + } + + /** * HasĀ etag? (private) * * @param string $etag etag http header |