Allow to use Cache-Control

This commit is contained in:
Garvin Hicking 2006-08-30 09:51:59 +00:00
parent 509a065caf
commit dcdf147af1
3 changed files with 16 additions and 0 deletions

View File

@ -3,6 +3,9 @@
Version 1.1-beta4 ()
------------------------------------------------------------------------
* Allow to set $serendipity['CacheControl'] to make serendipity emit
Cache-Control: HTTP headers. Thanks to annonymous from the forums!
* Use seperate PHP session ID when using HTTPS login. Set 'secure'
cookie parameters when using HTTPS. Thanks to lynoure!

View File

@ -23,6 +23,15 @@ header('X-Blog: Serendipity'); // Used for installer detection
ob_start();
include('serendipity_config.inc.php');
header('Content-Type: text/html; charset='. LANG_CHARSET);
if ($serendipity['CacheControl']) {
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')) {
header('Cache-Control: no-cache, pre-check=0, post-check=0');
} else {
header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header('Expires: 0');
header('Pragma: no-cache');
}
$track_referer = true;
$uri = $_SERVER['REQUEST_URI'];

View File

@ -87,6 +87,10 @@ if (!isset($serendipity['useHTTP-Auth'])) {
$serendipity['useHTTP-Auth'] = true;
}
if (!isset($serendipity['CacheControl'])) {
$serendipity['CacheControl'] = false;
}
// Should IFRAMEs be used for previewing entries and sending trackbacks?
$serendipity['use_iframe'] = true;