summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-31 00:33:56 -0400
committerEvan Prodromou <evan@status.net>2010-09-02 22:26:19 -0400
commitc8a69f433c8839280378551ac11290f1c8a2182e (patch)
tree7e7067f7f60e97026e3e942fc968851a75bd3873 /lib/action.php
parent0c5ca46ba3a070803d993b0244fcc69d33875ebd (diff)
add some caching headers
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php20
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