diff --git a/ChangeLog b/ChangeLog index 6fa78042f..15c3c3870 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,10 @@ $HeadURL$ by removing this uva prefix * libraries/export/sql.php: patch #1595784, add charset information to SQL export, thanks to Christian Schmidt + * css/phpmyadmin.css.php, libraries/session.inc.php, + libraries/Config.class.php, libraries/header_meta_style.inc.php: + patch #1611684, allow client caching of phpmyadmin.css.php, + thanks to Christian Schmidt 2006-12-07 Marc Delisle * libraries/ip_allow_deny.lib.php: checks that the header contains diff --git a/css/phpmyadmin.css.php b/css/phpmyadmin.css.php index 61397a785..55d19da89 100644 --- a/css/phpmyadmin.css.php +++ b/css/phpmyadmin.css.php @@ -25,6 +25,10 @@ if ($GLOBALS['text_dir'] === 'ltr') { // Send correct type: header('Content-Type: text/css; charset=ISO-8859-1'); +// Cache output in client - the nocache query parameter makes sure that this +// file is reloaded when config changes +header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT'); + ?> html { font-size: get('fontsize'); ?>; diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 36ffa251b..11ec56c22 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -28,6 +28,7 @@ class PMA_Config */ var $source_mtime = 0; var $default_source_mtime = 0; + var $set_mtime = 0; /** * @var boolean @@ -496,7 +497,10 @@ class PMA_Config */ function set($setting, $value) { - $this->settings[$setting] = $value; + if (!isset($this->settings[$setting]) || $this->settings[$setting] != $value) { + $this->settings[$setting] = $value; + $this->set_mtime = time(); + } } /** @@ -518,6 +522,15 @@ class PMA_Config $this->__construct($source); } + /** + * returns time of last config change. + * @return int Unix timestamp + */ + function getMtime() + { + return max($this->source_mtime, $this->default_source_mtime, $this->set_mtime); + } + /** * $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be * set properly and, depending on browsers, inserting or updating a diff --git a/libraries/header_meta_style.inc.php b/libraries/header_meta_style.inc.php index 49e71fbab..f17194fa4 100644 --- a/libraries/header_meta_style.inc.php +++ b/libraries/header_meta_style.inc.php @@ -36,5 +36,5 @@ if ($GLOBALS['text_dir'] == 'ltr') { } ?> - + diff --git a/libraries/session.inc.php b/libraries/session.inc.php index 004114f6d..85f240288 100644 --- a/libraries/session.inc.php +++ b/libraries/session.inc.php @@ -70,6 +70,10 @@ if (version_compare(PHP_VERSION, '5.0.0', 'ge') ini_set('session.hash_bits_per_character', 6); } +// some pages (e.g. stylesheet) may be cached on clients, but not in shared +// proxy servers +session_cache_limiter('private'); + // start the session // on some servers (for example, sourceforge.net), we get a permission error // on the session data directory, so I add some "@"