From 3fbe5ca4a40ea38de0e91cb89dabaa732ff23b60 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Tue, 12 Jan 2010 20:08:00 +0100 Subject: make browser cache time for images configurable --- type/Default.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'type') diff --git a/type/Default.class.php b/type/Default.class.php index ad880b3..ade3a16 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -5,6 +5,7 @@ class Type_Default { var $datadir; var $rrdtool; + var $cache; var $args; var $seconds; var $data_sources = array('value'); @@ -25,6 +26,7 @@ class Type_Default { function __construct($config) { $this->datadir = $config['datadir']; $this->rrdtool = $config['rrdtool']; + $this->cache = $config['cache']; $this->parse_get(); $this->rrd_files(); $this->identifiers = $this->file2identifier($this->files); @@ -114,7 +116,8 @@ class Type_Default { if(!$debug) { # caching - header("Expires: " . date(DATE_RFC822,strtotime("90 seconds"))); + if (is_numeric($this->cache) && $this->cache > 0) + header("Expires: " . date(DATE_RFC822,strtotime($this->cache." seconds"))); header("content-type: image/png"); $graphdata = implode(' ', $graphdata); echo `$graphdata`; -- cgit v1.1