From c8a69f433c8839280378551ac11290f1c8a2182e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 31 Aug 2010 00:33:56 -0400 Subject: add some caching headers --- lib/action.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 0b1cef365..31ae49881 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1004,9 +1004,29 @@ 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) * -- cgit v1.2.3-54-g00ecf