# HG changeset patch # User Nathan Phillip Brink # Date 2013-10-30 01:45:08 # Node ID 7d2e141f1b0171b951463fecb547ddf4734925e5 # Parent 555f118ada99906def9c0c8fbf33d1ec6d81f776 Fix Cache-Control to actually limit autocomplete caching to 10 minutes instead of 3 hours, reported by Jason VanHorn . diff --git a/auto.php b/auto.php --- a/auto.php +++ b/auto.php @@ -41,8 +41,6 @@ require_once('inc/class.course.inc'); */ if (!empty($_GET['school']) && !empty($_GET['semester'])) { - header('Expires: ' . gmdate(DATE_RFC1123, time() + 600)); - header('Cache-Control: max-age=600, public'); $cache_limiter = 'public'; } else @@ -54,7 +52,7 @@ else header('Vary: Cookie'); $cache_limiter = 'private'; } -page::session_start($cache_limiter); +page::session_start($cache_limiter, 10); if (isset($_REQUEST['txt'])) { header('Content-Type: text/plain; encoding=utf-8'); diff --git a/inc/class.page.php b/inc/class.page.php --- a/inc/class.page.php +++ b/inc/class.page.php @@ -651,13 +651,15 @@ class page * Specify the sort of session-related cache limitation is used, * see session_cache_limiter(). */ - public static function session_start($cache_limiter = 'nocache') + public static function session_start($cache_limiter = 'nocache', $cache_expire = NULL) { static $session_started = FALSE; if (!$session_started) { session_cache_limiter($cache_limiter); + if ($cache_expire !== NULL) + session_cache_expire($cache_expire); session_name('slate_permutate'); session_start(); $session_started = TRUE;