diff --git a/html/inc/cache.inc b/html/inc/cache.inc
index 01b470b0c0..53849b403d 100644
--- a/html/inc/cache.inc
+++ b/html/inc/cache.inc
@@ -28,57 +28,60 @@ function get_path($params) {
}
function start_cache($max_age, $params=""){
- $path = get_path($params);
- $request = getallheaders();
- // Check to see if this is a conditional fetch.
- $lastmodified = @filemtime($path);
+ if ($max_age) {
+ $path = get_path($params);
+ $request = getallheaders();
+ // Check to see if this is a conditional fetch.
+ $lastmodified = @filemtime($path);
- $if_modified_since = isset($request['If-Modified-Since']) ?
+ $if_modified_since = isset($request['If-Modified-Since']) ?
(explode(';',$request['If-Modified-Since'])) :
false;
- if ($if_modified_since) {
- $if_modified_since=strtotime($if_modified_since[0]);
- }
+ if ($if_modified_since) {
+ $if_modified_since=strtotime($if_modified_since[0]);
+ }
- if ($if_modified_since && ($if_modified_since == $lastmodified)) {
- Header("Last-Modified: " . gmdate("D, d M Y H:i:s",$lastmodified) . " GMT");
- Header('HTTP/1.0 304 Not Modified');
- exit;
- }
+ if ($if_modified_since && ($if_modified_since == $lastmodified)) {
+ Header("Last-Modified: " . gmdate("D, d M Y H:i:s",$lastmodified) . " GMT");
+ Header('HTTP/1.0 304 Not Modified');
+ exit;
+ }
- if ($lastmodified