Skip to content
Snippets Groups Projects
Commit 38f56bff authored by Ben Coburn's avatar Ben Coburn
Browse files

Enable '304 Not Modified' responses for CSS and JS.

darcs-hash:20060315115745-05dcb-6f50f3a070d2898ab51a32e59395631cab2ae09c.gz
parent 254e5c84
No related branches found
No related tags found
No related merge requests found
......@@ -67,10 +67,15 @@ function css_out(){
$files[DOKU_CONF.'userstyle.css'] = '';
}
// check cache age
// check cache age & handle conditional request
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
if(css_cacheok($cache,array_keys($files))){
http_conditionalRequest(filemtime($cache));
readfile($cache);
return;
} else {
http_conditionalRequest(time());
}
// start output buffering and build the stylesheet
......
......@@ -55,10 +55,15 @@ function js_out(){
// get possible plugin scripts
$plugins = js_pluginscripts();
// check cache age here
// check cache age & handle conditional request
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
if(js_cacheok($cache,array_merge($files,$plugins))){
http_conditionalRequest(filemtime($cache));
readfile($cache);
return;
} else {
http_conditionalRequest(time());
}
// start output buffering and build the script
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment