From 07525e80d6c29fb65bd5fff8206cb92bf74fa6b4 Mon Sep 17 00:00:00 2001 From: Ben Coburn <btcoburn@silicodon.net> Date: Mon, 10 Apr 2006 03:27:23 +0200 Subject: [PATCH] CSS and JS cache-control tweak Tells standards compliant browsers that conditional requests for CSS and JS need only be made once an hour. This should reduce page display latency on some browsers. Originated from the comment in this thread: http://www.freelists.org/archives/dokuwiki/03-2006/msg00590.html darcs-hash:20060410012723-05dcb-eccb42aefe85c9dbb4f35fdf03a9635561cf5710.gz --- lib/exe/css.php | 2 +- lib/exe/js.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/exe/css.php b/lib/exe/css.php index 5b4e560f4..d0b9461eb 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -67,7 +67,7 @@ function css_out(){ } // check cache age & handle conditional request - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public, max-age=3600'); header('Pragma: public'); if(css_cacheok($cache,array_keys($files))){ http_conditionalRequest(filemtime($cache)); diff --git a/lib/exe/js.php b/lib/exe/js.php index 0615db374..f18edc5d6 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -56,7 +56,7 @@ function js_out(){ $plugins = js_pluginscripts(); // check cache age & handle conditional request - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public, max-age=3600'); header('Pragma: public'); if(js_cacheok($cache,array_merge($files,$plugins))){ http_conditionalRequest(filemtime($cache)); -- GitLab