diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-03-26 14:43:41 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-03-26 14:43:41 -0400 |
commit | 820c929ab38273c80d0930e2e6140dd7676ba4df (patch) | |
tree | 3944047e41d14077f7e5e8c0d50856b360a22567 /app/Core/Http/Response.php | |
parent | e71f37238c82f01cd02d6d7343b42328d9603d14 (diff) |
Added avatar image upload
Diffstat (limited to 'app/Core/Http/Response.php')
-rw-r--r-- | app/Core/Http/Response.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Core/Http/Response.php b/app/Core/Http/Response.php index d098f519..37349ca5 100644 --- a/app/Core/Http/Response.php +++ b/app/Core/Http/Response.php @@ -14,6 +14,24 @@ use Kanboard\Core\Csv; class Response extends Base { /** + * Send headers to cache a resource + * + * @access public + * @param integer $duration + * @param string $etag + */ + public function cache($duration, $etag = '') + { + header('Pragma: cache'); + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $duration) . ' GMT'); + header('Cache-Control: public, max-age=' . $duration); + + if ($etag) { + header('ETag: "' . $etag . '"'); + } + } + + /** * Send no cache headers * * @access public |